I just need a function for counting a given word in a string.
There is something that has to do with split but I cant get what I should do from then.
Thank u for your time.
PS I forgot to mention. My apologies. I want to do that with javascript.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As I don’t know in which programming language you want to do this.
Here is a nice example of Word counting with frequency of occurrence in Javascript.
You can take a look what its doing by clicking ‘Try this example’ button.
There is word count, replace and capitalize.You just need the wordCount() function.