相关疑难解决方法(0)

在Python中的空白上拆分字符串

我正在寻找Python的等价物

String str = "many   fancy word \nhello    \thi";
String whiteSpaceRegex = "\\s";
String[] words = str.split(whiteSpaceRegex);

["many", "fancy", "word", "hello", "hi"]
Run Code Online (Sandbox Code Playgroud)

python regex string whitespace split

416
推荐指数
4
解决办法
63万
查看次数

标签 统计

python ×1

regex ×1

split ×1

string ×1

whitespace ×1