# indexOf("what")-what if i want to find all the what's in this sentence full of what's

**URL:** <https://forum.kirupa.com/t/indexof-what-what-if-i-want-to-find-all-the-whats-in-this-sentence-full-of-whats/288856>\
**Category:** flash\
**Created:** [May 21, 2009, 10:30pm UTC](https://forum.kirupa.com/t/indexof-what-what-if-i-want-to-find-all-the-whats-in-this-sentence-full-of-whats/288856 "2009-05-21T22:30:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)\
**Post date:** [May 21, 2009, 10:30pm UTC](https://forum.kirupa.com/t/indexof-what-what-if-i-want-to-find-all-the-whats-in-this-sentence-full-of-whats/288856/1 "2009-05-21T22:30:26Z")

</div>

damm, this week looks like its never ending…  
can anyone help me out here?

“what if i want to find all the what’s in this sentence full of what’s?”  
i cant do this with indexOf, and it wont work either with lastIndexOf, since there are 3…

i’m asking this because i’m trying to do a simple htmlText editor and got stuck in the part where i cant check the selected word’s position only with indexOf…

thanks in advance!!
