How to split pipe-separated string into a list? [duplicate]

The way to do this is clearly documented here.

Example:

>>> myString = "subString1|substring2|subString3"
>>> myString = myString.split("|")
>>> print myString
["subString1", "subString2", "subString3"]

Browse More Popular Posts

Leave a Comment