strsplit by spaces greater than one in R

前端 未结 1 726
感动是毒
感动是毒 2021-01-20 14:13

Given a string,

mystr = \"Average student score       88\"

I wish to split if there are more than 1 space. I wish to obtain the following:<

相关标签:
1条回答
  • 2021-01-20 14:40

    You may specify it through a repetition quantifier.

    strsplit(mystr, "\\s{2,}")
    

    \\s{2,} regex should match two or more spaces.

    0 讨论(0)
提交回复
热议问题