Вопрос

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