How to remove unicode from string?

前端 未结 4 1048
囚心锁ツ
囚心锁ツ 2020-11-27 23:27

I have a string like:

q <-\"  1000-66329\"

I want to remove and get only 1000 66329

4条回答
  •  广开言路
    2020-11-27 23:57

    If always is the first character, you can try:

    substring("\U00A6 1000-66B29", 2)
    

    if R prints the string as 1000-66329 instead of ¦ 1000-66B29 then is interpreted as the string "" instead of the unicode character. Then you can do:

    substring("  1000-66329",9)
    

    Both ways the result is:

    [1] "  1000-66329"
    

提交回复
热议问题