Difference between revisions of "GETWORDCOUNT()"
From Lianjapedia
Helen.george (Talk | contribs) |
|||
Line 22: | Line 22: | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | |||
[[Category:String Data Functions]] | [[Category:String Data Functions]] |
Latest revision as of 06:35, 4 February 2013
Contents
Purpose
Function to return the number of words in a string
Syntax
GETWORDCOUNT(<expC1> [, <expC2>])
See Also
AT(), ATNEXT(), GETWORDNUM(), INLIST(), LEFT(), OCCURS(), RAT(), RIGHT(), SET STRESCAPE, STR(), STREXTRACT(), STRPOS(), STRTRAN(), STUFF(), SUBSTR()
Description
GETWORDCOUNT() returns the number of words in the string <expC1>. By default, words are assumed to be separated by spaces or tabs. Alternative delimiting characters can be specified in <expC2>. If more than one delimiting character is included in <expC2>, each is counted as a delimiter, not the complete string as a single delimiter.
Example
cString = "AAA aaa, BBB bbb, CCC ccc. DDD ddd." ? getwordcount(cString) // = 8 character groups delimited by space ? getwordcount(cString, ",") // = 3 character groups delimited by "," ? getwordcount(cString, ".") // = 2 character groups delimited by "." ? getwordcount(cString, ",.") // = 4 character groups delimited by "," or "."