Programming Reference Manual
 
Syntax
 
stringclassobject.Replace sOld, sNew[, NumCount][, Reloop][, Compare]
 
Description
Replaces occurences of sOld with sNew in the text buffer of the StringClass variable. Optionally limits the number of replacements or reloops to enable subsequent replacements.
 
Parameter
Description
sOld
The string that is to be replaced
SNew
The string that replaces sOld
NumCount
Optional. The maximum number of occurences that will be replaced. When omitted, all occurrences of sOld will be replaced by sNew.
Reloop
Optional. When True, the replace method will restart and perform any replacements until the occurence of sOld no longer exists.
Compare
Optional. The type of comparison that will be used during the search. Only standard VB compare types are allowed.
Default value = vbTextCompare.
See Also

Example
 
Sub Main
 
Dim myStr As New StringClass
 
myStr.Append "Test"
myStr.Replace "s","x"
 
Debug.Print myStr 'text
 
End Sub