Split Strings into words with multiple word boundary delimiters

前端 未结 30 2708
既然无缘
既然无缘 2020-11-21 05:09

I think what I want to do is a fairly common task but I\'ve found no reference on the web. I have text with punctuation, and I want a list of the words.

\"H         


        
30条回答
  •  鱼传尺愫
    2020-11-21 05:56

    I'm re-acquainting myself with Python and needed the same thing. The findall solution may be better, but I came up with this:

    tokens = [x.strip() for x in data.split(',')]
    

提交回复
热议问题