wordcount

Count the number of words in a String.


Syntax


Parameters

  • String subject - The String to count the words of.
  • Number format - The format to return results in.
    • 0 (default) - The number of words found will be returned as an integer Number.
    • 1 - An Array will be returned, containing all the words found inside subject.
    • 2 - An Array will be returned just like if the value is 1, but each Array key will be the numeric position inside subject that the word is found at.
  • String charlist - A list of additional characters to be considered as "word".


Result

    • Number - The number of words in subject, if format is 0.
    • Array - The words found inside subject, if format is 1 or 2.

Returns information about the words used in subject. A "word" is a locale-dependant string containing alphabetic characters, which may contain, but not start with, single-quote (') and hyphen (-) characters.

ptpscript/functions/wordcount.txt · Last modified: 2007/01/24 10:15
 
 
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki