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

Popular Categories





How can i split a string value in different parts?

+1 vote
85 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 713 views
+2 votes
1 answer 141 views
+3 votes
1 answer 645 views
+2 votes
2 answers 788 views
–1 vote
0 answers 111 views
+2 votes
1 answer 53 views
asked in Programming by neha (560 points)
+1 vote
1 answer 145 views
+6 votes
2 answers 2,242 views
+1 vote
1 answer 778 views

Not a Member yet?

Ask to Folks Login

My Account
847 Folks are online
74 members and 773 guest online
Your feedback is highly appreciated