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

Popular Categories





How can i split a string value in different parts?

+1 vote
113 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 756 views
+2 votes
1 answer 171 views
+3 votes
1 answer 768 views
+2 votes
2 answers 799 views
–1 vote
0 answers 145 views
+2 votes
1 answer 76 views
asked in Programming by neha (560 points)
+1 vote
1 answer 168 views
+6 votes
2 answers 2,765 views
+1 vote
1 answer 875 views

Not a Member yet?

Ask to Folks Login

My Account
444 Folks are online
2 members and 442 guest online
Your feedback is highly appreciated