# Word count help

**URL:** https://forum.kirupa.com/t/word-count-help/315543
**Category:** flash
**Created:** [October 28, 2010, 12:26pm UTC](https://forum.kirupa.com/t/word-count-help/315543 "2010-10-28T12:26:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![m2244](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@m2244](https://forum.kirupa.com/u/m2244)
#### Post date: [October 28, 2010, 12:26pm UTC](https://forum.kirupa.com/t/word-count-help/315543/1 "2010-10-28T12:26:00Z")

</div>

Hello

I am trying to write a piece of code that will count the number of words in a textfield. The part that I am having a problem with is weeding out errors made by the user when they entered the text for instance,

word , word

I do not want the comma in the above text to be counted as a word

Also I want to ignore any time they put in 2 or more spaces between a word.

word word word

I am hoping to get away from doing a find and replace if possible.

Any suggestions?

Thanks in advance.
