Programming Reference:Functions:CCAddEscape
From CodeCharge Studio Community Wiki
Description
Add escape characters for literal or special symbols.
Location
Common
Syntax
CCAddEscape(string);
Return value
String
Parameters
| Name | Type | Description | Required |
| String | String | Text to have escape characters added. | Yes |
See also:
PHP
function CCAddEscape($FormatMask)
{
$meta_characters = array("\\", "^", "\$", ".", "[", "|", "(", ")", "?", "*", "+", "{", "-", "]", "/");
for($i = 0; $i < sizeof($meta_characters); $i++)
$FormatMask = str_replace($meta_characters[$i], "\\" . $meta_characters[$i], $FormatMask);
return $FormatMask;
}