Click to Rate and Give Feedback
MSDN
MSDN Library
Visual FoxPro
Reference
Language Reference
Functions
 GETWORDCOUNT( ) Function
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual FoxPro 9.0 SP2
GETWORDCOUNT( ) Function

Counts the words in a string.

GetWordCount(cString[, cDelimiters])

Parameters

cString

Specifies the string whose words will be counted.

cDelimiters

Optional. Specifies one or more optional characters used to separate words in cString. The default delimiters are space, tab, carriage return, and line feed. Note that GetWordCount( ) uses each of the characters in cDelimiters as individual delimiters, not the entire string as a single delimiter.

Numeric

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 "."
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker