Friday, 9 August 2013

Javascript Find the next occurrence of a "letter"

Javascript Find the next occurrence of a "letter"

I just need an idea!
If I have a string "string1, values, string2, values, string3, values, ....."
How can I get the index of the second string? why? because I want divide
this string into
"string1, values"
"string2, values"
...
by using substring(0, index-1 of the second string) and so on.
To be more clear I have
""a", 4, 2, 2, 4, 5, "b", 6, 4, 3, 6, 7, "x", 5, 6, 7, 8, .... "
I want the "second" occurrence of a letter

No comments:

Post a Comment