Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

function to get count of word in string

def get_len(text):

  '''function to get the count of words in string'''
  
  import re

  # using regex (findall())
  # to count words in string

  res = len(re.findall(r'w+', text))

  return res
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #function #count #word #string
ADD COMMENT
Topic
Name
5+6 =