我有一個(gè)看起來像的字符串:str<-"a\f\r"我正在嘗試刪除反斜杠,但沒有任何效果:gsub("\","",str, fixed=TRUE)gsub("\\","",str)gsub("(\)","",str)gsub("([\])","",str)...基本上所有您可以想象的變化。我什至嘗試了該string_replace_all功能。有幫助嗎?我正在使用R版本3.1.1;Mac OSX 10.7;將dput在我的琴弦的矢量一個(gè)字符串給出:dput(line)"ud83d\ude21\ud83d\udd2b"我使用的是readLines從標(biāo)準(zhǔn) .txt文件導(dǎo)入的 文件。該文件的內(nèi)容類似于: got an engineer booked for this afternoon \ud83d\udc4d all now hopefully sorted\ud83d\ude0a I m going to go insane ud83d\ude21\ud83d\udd2b in utf8towcs … 謝謝。
3 回答
- 3 回答
- 0 關(guān)注
- 1497 瀏覽
添加回答
舉報(bào)
0/150
提交
取消