문제

Let's say I have a string of words

txt = "The licenses for most software"
length(txt)
1

I can use strsplit to split it into its composite words

t = unlist(strsplit(txt, split=" "))
length(t)
5

Now I want to undo what I did. How can I reconnect 5 words together into the original string?

Thanks

도움이 되었습니까?

해결책

paste(t,collapse=" ") 
# [1] "The licenses for most software"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top