How python separates strings
In this article, the editor introduces in detail "how python separates strings". The content is detailed, the steps are clear, and the details are handled properly. I hope this "python how to separate strings" article can help you solve your doubts.
1 the function of spilt () method
Separates a string by specifying a delimiter
Note that the string to be split needs a regular delimiter. For example, there is a space in the middle of the string "Python is a good language", so we can separate the string by this space.
2 demo explains the use of spilt ()
2.1 separate characters by specified characters
C = "Python is a good language" d = c.split (") print (d)
2.2 separate specified characters
C = "Python is a good language" d = c.split (", 2) print (d)
2.3 get a cut character
C = "Python is a good language" d = c.split ("") [3] print (d) read here, this article "how to separate strings by python" has been introduced. If you want to grasp the knowledge of this article, you need to practice and use it before you can understand it. If you want to know more about related articles, please follow the industry information channel.