Next Previous Contents

61. str_quote_string

Synopsis

Escape characters in a string.

Usage

String_Type str_quote_string(String_Type str, String_Type qlis, Integer_Type quote)

Description

The str_quote_string returns a string identical to str except that all characters in the set specified by the string qlis are escaped with the quote character, including the quote character itself. This function is useful for making a string that can be used in a regular expression.

Example

Execution of the statements

   node = "Is it [the coat] really worth $100?";
   tag = str_quote_string (node, "\\^$[]*.+?", '\\');
will result in tag having the value:
    Is it \[the coat\] really worth \$100\?
See Also

str_uncomment_string, make_printable_string


Next Previous Contents