Vote count:
0
So I was wondering how you would use indexOf() or related method to return all instances of a character occurring in a string. What I have right now does the following:
- I have a word
"sneest" - I enter
eand it displays2. I want it to display2,3
asked 3 mins ago
1 Answer
Vote count:
0
int pos = str.indexOf("foo"):
while (pos >= 0) {
//do something
pos = str.indexOf("foo", pos + 1):
}
answered 13 secs ago
Aucun commentaire:
Enregistrer un commentaire