Doubt with String
Hi, how can I get the index of the n occurrence of a String inside a string
(i. e.) I have the string
"<td>xxx</td><td>yyy</td><td>zzz</td>"
I want to know the index of the second or first of third or any occurrence of "<td>"
I've seen IndexOf, but it only returns the first occurrence.
[386 byte] By [
Chidoa] at [2007-11-26 18:02:42]

String str = "<td>xxx</td><td>yyy</td><td>zzz</td>";
String td = "<td>";
int first = str.indexOf(td);
int second = str.indexOf(td, first + 1);
int third = str.indexOf(td, second + 1);
Oh, I misread the question.Well, you can still use the indexOf(String str, int fromIndex), applied repeatedly until you get to where you're looking for. Or you might be able to cook up a regex.