Share via


GETWORDCOUNT( ) Function

Counts the words in a string.

GetWordCount(cString[, cDelimiter])

Parameters

  • cString
    Specifies the string whose words will be counted.
  • cDelimiter
    Optional. Specifies the character used to delimit character groups in cString. Use this to determine the number of character groups, delimited by the specified character, in cString.

Return Value

Numeric

Remarks

GetWordCount( ) by default assumes that words are delimited by spaces or tabs. If you specify another character as delimiter, this function ignores spaces and tabs and uses only the specified character.

If you use "AAA aaa, BBB bbb, CCC ccc." as the target string for GetWordCount( ), you can get all the following results.

cString = "AAA aaa, BBB bbb, CCC ccc."
? GetWordCount(cString)               && 6 - character groups, delimited by " "
? GetWordCount(cString, ",")               && 3 - character groups, delimited by ","
? GetWordCount(cString, ".")               && 1 - character group, delimited by "."

See Also

GETWORDNUM( ) Function