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
You need to look into Regular Expressions:
String[] s = myString.split("\\:"); // escape the colon just in case as it has special meaning in a regex
Or you can also use a StringTokenizer.