+1 vote
165 views
in Programming by (1.7k points)

i want to split a string this is my code :

String url = objSession.get("url");

i want to split this url.

 

closed

1 Answer

+1 vote
by Expert (6.4k points)
selected by
 
Best answer

you can do like this:

String split = objSession.get("url");
String[] parts = split.split(":");
String part1 = parts[0]; 
String part2 = parts[1];
System.out.println(part1);
System.out.println(part2);
 
by (1.7k points)
thanks its working :)

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated