======wordcount====== Count the number of words in a [[PTPScript:Types:String|String]]. \\ **Syntax** * ''[[PTPScript:Types:Mixed|Mixed]] wordcount( [[PTPScript:Types:String|String]] subject [, [[PTPScript:Types:Number|Number]] format [, [[PTPScript:Types:String|String]] charlist ] ] )'' \\ **Parameters** * [[PTPScript:Types:String|String]] ''subject'' - The String to count the words of. * [[PTPScript:Types:Number|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. * [[PTPScript:Types:String|String]] ''charlist'' - A list of additional characters to be considered as "word". \\ **Result** * [[PTPScript:Types:Mixed|Mixed]] * [[PTPScript:Types:Number|Number]] - The number of words in ''subject'', if ''format'' is ''0''. * [[PTPScript:Types:Array|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.