We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
语法:
str.split(str="", num=string.count(str))
str --> 分隔符,默认为所有的空字符 包括空格 换行(\n) 制表符(\t)等。 num --> 分割次数。
例子:
str = "Line1-abcdef \nLine2-abc \nLine4-abcd"; print str.split( ) print str.split(' ', 1 )
['Line1-abcdef', 'Line2-abc', 'Line4-abcd'] ['Line1-abcdef', '\nLine2-abc \nLine4-abcd']
s = "there is a string here" s.splt() # ['there','is','a','string','here'] s.split(" ",1) #['there','is a string here'] s.spilt(" ",2) # ['there','is','a string here']
The text was updated successfully, but these errors were encountered:
#9
5ffa2cb
No branches or pull requests
语法:
str --> 分隔符,默认为所有的空字符 包括空格 换行(\n) 制表符(\t)等。
num --> 分割次数。
例子:
The text was updated successfully, but these errors were encountered: