Xbasic

OCCURSI Function

Syntax

Count as N = OCCURSI(C searchfor,C searchin)

Arguments

searchfor

The character string to find and count.

searchin

The character string to examine.

Description

Returns the number of times one Case Insensitive string is found in another.

Discussion

OCCURSI() returns the number of times the searchfor is found in the searchin. The searchin cannot be a memo field. Case insensitive.

Example

occursi("i", STATE) -> 4, if STATE contains "Mississippi"
occursi("at", "The cat in the hat") -> 2
occursi("ab", "ABCDabcd") -> 2

See Also