String splitting functions in Python

26-01-23 Ahmed Obaid 937 0

Python provides a lot of built-in functions for manipulating strings. String in Python is immutable, so all these functions return a new string and the original string remains unchanged. You do not have to memorize all of these functions that we will mention in this article. All you have to know is how to use these functions and what they can do. All of these functions are present by default in the str class inside the builtins.py file, which is included in the Python interpreter. 






















name description URL
split()   ​The split() function splits the string by the specified separator and returns a list of string elements. read more 
splitlines() ​The splitlines() function splits the string based on line breaks and returns a new list of the split strings. Line breaks can be a newline (\n ), a carriage return (\r) and so on. Below is a table of line breaks that divide the string. read more 



Tags


Python python data types Python String string methods python python string split method python string splitlines method String splitting functions in Python

Share page