C
Cirene
I have a long string (MyString) with several token/value combinations.
Here's an example...
NAME: JOHN ADDRESS: 123 MAIN ST COUNTY: SOMEWHERE
PHONE: 333-222-5151 x542 EMAIL: (e-mail address removed)
How can I easily parse out a few of these tokens? For example, if I want to
get the COUNTY, or PHONE?
I would think that the split function would work, but this doesn't seem to
work. Here's an example...
MyString.split("PHONE:")(1).split("EMAIL: ")(0)
My logic: First do a split and get the phone number portion, then "cut off"
everything after the phone number by "splitting" again at the email and
taking the first token, which would contain the phone number.
But this doesn't seem to work. Am I even close?????
Thanks!
Here's an example...
NAME: JOHN ADDRESS: 123 MAIN ST COUNTY: SOMEWHERE
PHONE: 333-222-5151 x542 EMAIL: (e-mail address removed)
How can I easily parse out a few of these tokens? For example, if I want to
get the COUNTY, or PHONE?
I would think that the split function would work, but this doesn't seem to
work. Here's an example...
MyString.split("PHONE:")(1).split("EMAIL: ")(0)
My logic: First do a split and get the phone number portion, then "cut off"
everything after the phone number by "splitting" again at the email and
taking the first token, which would contain the phone number.
But this doesn't seem to work. Am I even close?????
Thanks!