Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > The Clib Object String Methods > Clib.strspn() MethodThis method searches a string for characters that are not among a group of specified characters. Syntax
ReturnsIf all matching characters are found, the length of the string; otherwise, the offset of the first matching character from the beginning of string. UsageThis method searches the parameter string for any of the characters in the string charSet, and returns the offset of that character. The search is case-sensitive, so you may have to include both uppercase and lowercase instances of the characters to search for. This method is similar to Clib.strpbrk(), except that Clib.strpbrk() returns the string beginning at the first character found, while Clib.strcspn() returns the offset number for that character. When possible, you should use the standard JavaScript method substring() (read string.replace() Method). ExampleThe following fragment demonstrates Clib.strcspn(). When searching var string = "There is more than one way to skin a cat."; This results in the following output: See AlsoClib.strchr() Method |
Siebel eScript Language Reference |