parse out string field in crystal

I have a string field that holds city, state zip I need to parse out state for a crystal reprot
patsylippAsked:
Who is Participating?
 
JayConverseConnect With a Mentor Commented:
Press F1 and take a look at the Split() function.  Assuming consistent formatting of the data, i.e.,

city{COMMA}{SPACE}state{space}zip

You would split once on ", " and take the second array element

then split again on " " and take the first array element

0
 
mlmccConnect With a Mentor Commented:
Or if you just need the state always
This assumes you always have a city and state

Split({YourField}," ")[2]

mlmcc
0
 
James0628Commented:
mlmcc,

 That won't work so well with city names that are 2 or more words.  But, then again, what are the odds of that happening?  ;-)

 James
0
 
GJParkerCommented:
It woudl be far simpler to help you if you at least provided a sample of your data format rather than having to guess.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.