replace(find: String; (JadeRichText) replace: String; start: Integer; finish: Integer; options: Integer): Integer; replace(replacement: String; (JadeTextEdit) interpretation: Integer): Integer;
The replace method of the JadeRichText class replaces text in the receiver. (For an example of the use of this method, see "JadeRichText Control Method Example", earlier in this document.)
The replace method returns the number of replacements that are made.
The JadeRichText class replace method parameters are listed in the following table.
Parameter | Description |
---|---|
find | Text to be located. |
replace | The text that replaces instances of text in the receiver matching that specified by the find parameter. |
start | Start of the search range, as a character index into the text or specified as Find_BeginningOfText. |
finish | End of the search range, as a character index into the text or specified as Find_EndOfText. |
options | One or more of the following values, separated by the plus symbol (+). |
|
|
|
|
|
|
|
Instances of text in the receiver matching the text specified in the find parameter are replaced by text specified in the replace parameter. The replace method of the JadeTextEdit class replaces the most recent find match in the text editor with the replacement text specified in the replacement parameter.
Use the interpretation parameter to specify one of the following JadeTextEdit class constants.
FIND_INTERP_NONE (0), to replace text as is
FIND_INTERP_POSIXREGEXPR (3), to replace text after converting backslash control characters and inserting tagged regions (\n, where the n value is in the range 1 through 9)
FIND_INTERP_REGEXPR (2), to replace text after converting backslash control characters and inserting tagged regions
FIND_INTERP_UNSLASH (1), to replace text after converting backslash control characters
Each replace action in the text editor can be undone separately. A successful replace action automatically calls the findAgain method and returns the result of that find. If no recent find action was performed, the replace action is not performed.
For more details about interpretation, see the find method.