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 character in string that is not a member of charSet. UsageThis method searches the characters from the beginning of string, then returns the offset of the first character that is not a member of charSet. The search is case sensitive, so you may have to include both uppercase and lowercase instances of characters in charSet. This method is similar to Clib.strpbrk(), except that Clib.strpbrk() returns the string beginning at the first character found, while Clib.strspn() returns the offset number for that character. When possible, you should use the standard JavaScript method substring() (see String replace() Method). ExampleThe following fragment demonstrates Clib.strspn(). When searching var string = "There is more than one way to swim."; This results in the following output: See AlsoClib.strchr() Method |
Siebel eScript Language Reference |