-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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
tms
  • 146
  • 2
  • 10

1 Answers1

14

The way to do this is clearly documented here.

Example:

>>> myString = "subString1|substring2|subString3"
>>> myString = myString.split("|")
>>> print myString
["subString1", "subString2", "subString3"]
scrpy
  • 985
  • 6
  • 23
Ryan Schaefer
  • 3,047
  • 1
  • 26
  • 46