I have a string that has the value of name:score. I want to split the string into two strings, string a with the value of name and str
name:score
a
name
The split function is suitable for that :
split
String[] str_array = "name:score".split(":"); String stringa = str_array[0]; String stringb = str_array[1];