Search
 
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
Name
7+3 =