I have String variable name is Address.
And Address value is = 1 Training Road, home PL7 9DB.
I need to result
variable 1= 1 Training Road
Variable 2= home
Variable 3= PL7 9DB
Variable Address value will be change for next Address.
Example-2
Address:- Sheffeild house, sheffield S1 3EZ
I need this:
Variable 1 = Sheffeild house
Variable 2 = sheffield
Variable 3 = S1 3EZ
I need first variable till (Flat 24 & 26) , and second variable before Upper case (Crawford Towers Gulford ) and third last upper case with number(GU1 1UP)
To split the string in using “,” is simple u just have to have to use the below lines
VariableName.tostring.split(“,”) this will; give u the “Flat 24 & 26” as string one and the rest of the sentence as another variable.
If u want to split other values use Substring or Split the string by space and merge the required.
Thanks For the input Example strAddress="Flat 24 & 26, Crawford Towers Gulford GU1 1UP"
Step 1: Variable1 = strAddress.split(","c)(0)
Step 2: Variable2a=strAddress.split(","c)(1)
Step 3:
Use Regex to get the variable 3 value
Pattern : [A-Z]+[0-9].*
Step 4: variable2=variable2a.replace(variable3,"")
Hi Arivu,
I have done as suggested by you…
But I am not able to split “Crawford Towers Gulford GU1 1UP” value
I need it in to split value
No 1 before upper case value that is "Crawford Towers Gulford "
and I need “GU1 1UP” in another variable.