+ 4
What is the use of split() in python?
6 Answers
+ 4
Kishore Kumar BP
The split() method splits a string into a list. You can specify the separator, default separator is any whitespace. Note: When maxsplit is specified, the list will contain the specified number of elements plus one.
https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/ref_string_split.asp#:~:text=The%20split()%20method%20splits,number%20of%20elements%20plus%20one.
+ 5
Thanks for the answer š
+ 5
Thanks ā¤ļøšPreranašā¤ļø for additional info š
+ 2
To split string into list .
"Hello world" to convert the string to ["hello","world"] you may use
"Hello world". split(" ")
+ 2
Welcome āŗļø
Kishore Kumar BP
+ 1
The split method of string splits a string to a list. Ex.
'abcbd'.split('b') >> ['a' , 'c' , 'd']
Here the string abcbd is divided taking 'b' as the point of division.