DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
count words in a string
function WordCount(str) { return str.split(" ").length; } console.log(WordCount("hello world"));
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#count
#words
#string
ADD COMMENT
Topic
COMMENT
Name
1+1 =
Submit