Documentation Center

PslStringCounter.WordCount

Contains the number of words delimited by white-spaces and punctuation characters.

Syntax

Expression.WordCount as Long

Expression Required. Object of type PslStringCounter

Example

Sub main
  Dim test As String
  test = "This is a test!!!"

  Dim counter As PslStringCounter
  Set counter = PSL.GetTextCounts(test)
  PSL.Output "Counting """ & test & """:"
  PSL.Output "StringCount = " & counter.StringCount
  PSL.Output "WordCount = " & counter.WordCount
  PSL.Output "LetterCount = " & counter.LetterCount
  PSL.Output "CharCount = " & counter.CharCount
End Sub

Counting "This is a test!!!"

StringCount = 1

WordCount = 4

LetterCount = 11

CharCount = 17