I am trying to use indexOf(” “); on this string
"This i$ an aardvaAr yeEeeAs onDo qwerty XYZ9";
this is my code
space = word.indexOf(" ");
tempWord = word.substring(0, space);
Now I get what I want which is This string but now how do I get the next space which has this after it:i$, and the next one unitl the end of the string?
*EDIT
Please no arrays for this question
Use the overload of
indexOfwhich takes the starting index too:(Although there may very well be a better approach to your bigger problem.)