Split string into substrings on one or more whitespaces

前端 未结 2 1779
南旧
南旧 2020-12-11 05:55

I want to split a string into several substrings at those positions where one or more whitespaces (tab, space,...) occur. In the documentation of strsplit() it says, that sp

2条回答
  •  执念已碎
    2020-12-11 06:38

    Try

    strsplit(test, '\\s+')
    [[1]]
    [1] "123"    "nnn"    "ffffdffffd"
    

    \\s will match all the whitespace characters.

提交回复
热议问题