flexpadawan Posted May 15, 2009 Share Posted May 15, 2009 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 More sharing options...
svenn Posted May 15, 2009 Share Posted May 15, 2009 You could create a helper class using a scriplet. Link to comment Share on other sites More sharing options...
dman Posted May 18, 2009 Share Posted May 18, 2009 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, dmanPost Edited by dman at 05/18/2009 07:53 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now