-45

I have this string:

var(HELLO,)|var(Hello again)| var(HOW ARE YOU?)|outV(0)|outV(1)|outV(2)|END

I want to split it on the |. I don't want it to split at the white space, only at the |.

Is this possible?

0

1 Answer 1

14

The way to do this is clearly documented here.

Example:

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.