Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
34
rated 0 times [  40] [ 6]  / answers: 1 / hits: 17291  / 12 Years ago, sun, december 2, 2012, 12:00:00

I have string as this is test for alternative. What I want to find is location of for. I know I could have done this using alert(myString.indexOf(for)), however I don't want to use indexOf.



Any idea/ suggestion for alternative?



jsfiddle



Again, I need this done by Javascript only. No jQuery.. sadly :(


More From » indexof

 Answers
29
.search()?

this is test for alternative.search(for)
>> 13

[#81665] Friday, November 30, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
koltenb

Total Points: 276
Total Questions: 92
Total Answers: 101

Location: North Korea
Member since Fri, Nov 4, 2022
2 Years ago
;