[Overview][Resource strings][Constants][Types][Procedures and functions][Index] | Reference for unit 'strutils' (#rtl)

# WordCount

Count the number of words in a string.

## Declaration

Source position: strutils.pp line 165

`function WordCount(`
`const S: string;`
`const WordDelims: TSysCharSet`
`):Integer;`

## Arguments

`S` |  | String to search in.
`WordDelims` |  | Characters to be used as word delimiters.

## Function result

Number of words in the string.

## Description

WordCount returns the number of words in the string S. A word is a non-empty string of characters bounded by one of the characters in WordDelims.

The pre-defined StdWordDelims constant can be used for the WordDelims argument.

## Errors

None.

## See also

WordPosition |  | Search position of Nth word in a string.
StdWordDelims |  | Standard word delimiter values.
ExtractWord |  | Extract the N-th word out of a string.
ExtractWordPos |  | Extract a word from a string, and return the position where it was located in the string.

Documentation generated on: Feb 26 2014