I am using the following code to remove the special characters from the begining of a word:
>gsub("^[^[:alnum:]]",'','#C++')
[1] "C++"
But If there are multiple special characters in the beggining it removes only the first one:
>gsub("^[^[:alnum:]]",'','$#C++')
[1] "#C++"
How can I make it to remove all the special characters in the begining so the output should be "C++"
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…