The following variable:
x <- "^howdy"
Passed into the paste function like thus:
paste(x, "there", sep=".")
Returns the string "^howdy.there" as expected. 开发者_StackOverflow社区How can you eliminate the caret from howdy so the string returns only "howdy.there"? 
You can do this using gsub:
paste(gsub("^","",x,fixed=TRUE),"there",sep=".")
If you have a character vector and need to remove any non-alphanumeric characters, this slightly-more-complicated regular expression will be more efficient than explicitly specifying each character manually.
> gsub("[^[:alnum:]._]","",c("&hi_there%","^howdy.there"))
[1] "hi_there"    "howdy.there"
In regular expressions, the contents of [] are called a "character class" and each character inside the [] will be matched (or not matched if the first character is ^ as in the example above).  So we can use gsub to replace all characters that aren't alphanumeric, period, or underscore with the null string "".
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论