monkeytooth Posted July 23, 2011 Share Posted July 23, 2011 Lets say I have a string var myString = "I was sitting at the green light thinking about the Green Hornet and thought about the greenish tints he had on the windows"; I need to split the string so its broken down by spaces like a CSV but just the space.. Then I need to find every instance of "green" but case sensitive, any ideas? I thought I had an idea but I just ended up doing something entirely wrong... What I need my output to look like is 20, 45, 50.. (thats not exact but just for the sake of sample). What i need to know is the indexOf() splitting it into an array is for something else. which the spliting I have an understanding of.. Its the indexOf for multiple instances thats got me confused. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.