Method RegEx():quickReplace() Foundation

Performs a one-time search and replace.

Syntax
:quickReplace( <cPattern>, <cSubject>, [<cReplacement>] ) --> cString
Parameters
<cPattern>
The regular expression pattern.
<cSubject>
The subject string to process.
<cReplacement>
The replacement text. This defaults to the empty string (""), which means the matched occurences will be erased.
Return

A modified string with the replacements.

Description

Convenience class method for replacing all occurrences of a pattern without having to first create a RegEx object.

Quick replace

cClean := RegEx():quickReplace("\s+", "  too   many   spaces  ", " ") 
? cClean  // " too many spaces " 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.