Jump to content
We've recently updated our Privacy Statement, available here ×

regexp Question


flexpadawan

Recommended Posts

Hey All,

I have a situation where the data returning to me needs to be spit into three parts and used in three different text fields.

And I'm not sure how to go about doing it or if using a regexp is the best solutions.  The '/' is the serperator.

 

Here is my string:  "Test 1234/Data/More Data"

Text 1 = "Test 1234"

Text2 = "Data"

Text3 = "More Data"

 

Thanks.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

if you know the number of parts within your text, you could assign your your text to a String variable (such as $V{myText}) and use it this way:

text1 = $V{myText}.split("/")[0]

text2 = $V{myText}.split("/")[1]

text3 = $V{myText}.split("/")[2]

textN = $V{myText}.split("/")[n]

regards, dman



Post Edited by dman at 05/18/2009 07:53
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...