I am trying to spilt a word into segments whenever the char "," occurs in the word.
String name= "[John, David]"
So the two segments should be John and David, which ignore the following
" [ "
" ] "
" , "
This can work if I use substring, but I have to have a fixed amount of words, but the number of words will be dynamic.
I can do this with seperate chars and store each segment into an array, but I need help doing it with words.