replace

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 (+).
 
  • Find_MatchCase, which finds only text with the matching case; otherwise search is case-insensitive.

 
  • Find_WholeWord, which finds only whole words; otherwise parts of words satisfy the search.

 
  • Find_SearchBack, which searches backwards through the text; otherwise the search direction is forward to the end of the text.

 
  • Replace_ReplaceAll, which replaces all occurrences of the located (found) text in the receiver.

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.

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.