Searches in sString for the first character that does not belong to the set of characters in sCharacterSet.
Kernel.bdh
Strspn( in sString : string, in sCharacterSet : string ): number;
Index of the first character in sString that does not belong to the set of characters in sCharacterSet. If sString begins with a character not in sCharacterSet, the function returns 1.
Parameter | Description |
---|---|
sString | Defines the string to search in |
sCharacterSet | Defines a set of character as a search criteria |
dcltrans transaction TStrspn var sString, sSet : string; nIndex : number; begin sString := "Hello world!"; sSet := "ABCDEFGHabcdefgh"; write("string = "); write(sString); writeln; write("set = "); write(sSet); writeln; nIndex := Strspn(sString, sSet); write("index = "); write(nIndex); writeln; end TStrspn;
string = Hello world! set = ABCDEFGHabcdefgh index = 3