Function Block STRSPN

The Function Block STRSPN determines the length of the initial section of a string that consists exclusively of characters contained in a passed mask.

Note: This function is Binary-Safe. This means that UTF8 characters cannot be processed directly.

Input STR

Defines the string to be examined.

Input CHARS

Defines the mask as a set of allowed characters.

Input OFFSET

Defines the position as an integer at which the search begins.

If the offset is negative, the search begins with calculated offset from the end of the string at input STR.

Input LEN

The length to be examined of the section from input STR.

If no length has been defined, the examination continues until the end of the string.

Output

The output returns the number of occurrences of characters CHARS in STR.