+ 2
I want to split strings in JAVA ?
I have a text.For eg: 134 SW OF TEXAS, US /* I have to separate the string after 'OF' and save it into two different string..how can I do that **/ 134 SW OF into a String and TEXAS, US into a different String ??
9 Réponses
+ 4
Rishabh how about this method
https://code.sololearn.com/c7B1TxK752zl/?ref=app
+ 8
https://code.sololearn.com/c2PYIvz3UW3Z/?ref=app
+ 7
Maybe you can use
String str="134 SW OF TEXAS, US";
String[] arr= str.split("OF");
String a=arr[0];
String b=arr[1];
+ 4
Sorry, I posted the wrong link earlier.😅
+ 3
thanks JonathanP
+ 3
Anyone have more ideas to do this JonathanP Muhd Khairul Amirin Bin Yaacob
+ 2
thanks Muhd Khairul Amirin Bin Yaacob but I'm looking for another way to do it!!
+ 2
the method in your code & this code u have written are based on same concepts ..I'm looking for something different Muhd Khairul Amirin Bin Yaacob
+ 1
😒😒😒😒😒 JonathanP