|
Previous Top Next |
Prototype: | (String pFind, String pReplace, *String pSearchS),Long,PROC |
pFind | The string to search for. |
pReplace | The string to replace with. |
pSearchS | The string to search and replace in. Note that this is passed by address so you must pass a variable to this method. |
Returns | The replaced string. |
This is a simple but powerful search and replace method. The method is overloaded with a method that takes a *CString parameter so it can be used with both string variables and CString variables. The search is NOT case sensitive.
NOTE: The string or cstring variable used, is NOT dynamic and is NOT expanded to hold the data if it is too big. If you anticipate to replace a small string with a big one, you have to consider that the variable that you are passing in with the string (pSearchS) may not be big enough to hold the string after the search and replace has taken place.
Example:
S String(255)
ITC ITCoreClass
Code
S = 'Check this out now'
ITC.SearchReplace('now','NOW',S) ! S is now: 'Check this out NOW'
See also: