假设我有一串字
txt = "The licenses for most software"
length(txt)
1
Run Code Online (Sandbox Code Playgroud)
我可以使用strsplit将其拆分为复合词
t = unlist(strsplit(txt, split=" "))
length(t)
5
Run Code Online (Sandbox Code Playgroud)
现在我想撤消我所做的事情。如何将5个单词重新连接到原始字符串中?
谢谢
paste(t,collapse=" ")
# [1] "The licenses for most software"
Run Code Online (Sandbox Code Playgroud)