Issue
I have a String Chocolate:30:2
in a variable and I want to extract the number after the second colon i.e. 2
. So, How can I extract that number?
Solution
For example:
String s = "Chocolate:30:2";
String number = s.split(":")[2];
Answered By - Alex
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.