-42

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?

Dharman
  • 26,923
  • 21
  • 73
  • 125
tms
  • 123
  • 2
  • 7

1 Answers1

12

The way to do this is clearly documented here.

Example:

>>> myString = "subString1|substring2|subString3"
>>> myString = myString.split("|")
>>> print myString
["subString1", "subString2", "subString3"]
scrpy
  • 917
  • 6
  • 23
Ryan Schaefer
  • 2,952
  • 1
  • 23
  • 43