# Counting a specific character in a string

**URL:** <https://forum.kirupa.com/t/counting-a-specific-character-in-a-string/88183>\
**Category:** flash\
**Created:** [April 27, 2005, 11:26am UTC](https://forum.kirupa.com/t/counting-a-specific-character-in-a-string/88183 "2005-04-27T11:26:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hommer](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@Hommer](https://forum.kirupa.com/u/Hommer)\
**Post date:** [April 27, 2005, 11:26am UTC](https://forum.kirupa.com/t/counting-a-specific-character-in-a-string/88183/1 "2005-04-27T11:26:29Z")

</div>

I’m making a little program that has to count specific characters in a string.  
Let’s say the user inputs a name (I.e. “John Jabbadoo Jackson”) and I need to count all the o’s in the string. In this case it should be 4.  
How would the script look like?
