DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
count a character in a string, js
"this is foo bar".split("o").length - 1; // returns 2
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#count
#character
#js
ADD COMMENT
Topic
COMMENT
Name
7+3 =
Submit