Split string based on a regular expression

后端 未结 4 1878
我寻月下人不归
我寻月下人不归 2020-11-27 12:26

I have the output of a command in tabular form. I\'m parsing this output from a result file and storing it in a string. Each element in one row is separated by one or more w

4条回答
  •  天涯浪人
    2020-11-27 13:09

    Its very simple actually. Try this:

    str1="a    b     c      d"
    splitStr1 = str1.split()
    print splitStr1
    

提交回复
热议问题