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