ReplaceAll - DfBaseRichEdit
Replaces all occurences of sTarget with sReplacement and returns the number of replacements
Type: Function
Return Data Type: integer
Parameters
| Parameter | Type | Description |
|---|---|---|
| sTarget | string | String to be replaced with sReplacement |
| sReplacement | string | String to take the place of sTarget |
Syntax
Function ReplaceAll string sTarget string sReplacement Returns integer
Call Example
Get ReplaceAll sTarget sReplacement to integerVariable
Description
Replaces all occurences of sTarget with sReplacement in control and returns the number of replacements made.
This method has no effect if control is not paged.
Sample
This sample replaces all occurences of "Mike" in control oRichEdit1 with "Michael" and then displays the number of replacements made in a message box to the user.
Procedure ReplaceAll
integer iReplacementCount
get ReplaceAll of oRichEdit1 "Mike" "Michael" to iReplacementCount
send Info_Box (string(iReplacementCount) + " replacements performed")
End_Procedure // ReplaceAll
See Also
Return Value
Number of replacements made. If no repalcements were made, returns 0.