Hey there! any question in your mind? Ask It Now!.

Popular Categories





How can i split a string value in different parts?

+1 vote
124 views
asked in Programming by nitu (1,680 points)

i want to split a string this is my code :

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

i want to split this url.

 

1 Answer

+1 vote
answered by krish Expert (6,310 points)
selected by nitu
 
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);
 
commented by nitu (1,680 points)
thanks its working :)

Related Questions

+4 votes
5 answers 779 views
+2 votes
1 answer 181 views
+3 votes
1 answer 831 views
+2 votes
2 answers 812 views
–1 vote
0 answers 157 views
+2 votes
1 answer 92 views
asked in Programming by neha (560 points)
+1 vote
1 answer 175 views
+6 votes
2 answers 3,034 views
+1 vote
1 answer 926 views

Not a Member yet?

Ask to Folks Login

My Account
353 Folks are online
0 members and 353 guest online
Your feedback is highly appreciated