Sfairadora

  • Reference Guide

skip_chars

skip_chars(str, n, set)
Returns the index of the first character in the string str after the position n (including the character at the index n) that is not contained in the string set. In other words, the function skips all characters contained in the specified set. If no such character is found, the function returns the size of the string str. The index of the first character in the string is 0. If n is negative, 0 is used.
The parameter str can be a String, Text or Rich_string. The parameter n and the return value are of the type Int. The parameter set is a String. If the parameter str is a Rich_string, then the set can be a Rich_string, too. In that case, the format of the characters in the set is also regarded.
The functions whose name begins with skip_… serve to analyze a string. The best way to use them is to create a variable containing an index (pointer) of the current position within the string. This variable is passed to the appropriate skip­_… function as the parameter determining the place, where to search the string from. The resulting value (the new pointer) is then assigned back to the variable.
Example:
pos = skip_chars(str, pos, " `t`n`r")
This example skips all space characters (i.e. the characters that are a space, tabulator or a new-line).
Note: this function serves to manipulate character strings. To handle binary data, use the analogical function skip_bytes.

See Also