我正在寻找相当于的Python
String str = "many fancy word \nhello \thi"; String whiteSpaceRegex = "\\s"; String[] words = str.split(whiteSpaceRegex); ["many", "fancy", "word", "hello", "hi"]
str.split()不带参数的方法在空白处分割:
str.split()
>>> "many fancy word \nhello \thi".split() ['many', 'fancy', 'word', 'hello', 'hi']