www.icetips.com  Icetips Utilities Documentation 5/9/2015    

Core Class: SearchReplace

Previous  Top  Next  


Prototype:  (String pFind, String pReplace, *String pSearchS),Long,PROC

 

pFindThe string to search for.

       

pReplaceThe string to replace with.

 

pSearchSThe string to search and replace in.  Note that this is passed by address so you must pass a variable to this method. 

 

ReturnsThe 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:

Construct

 

 

 



Direct link to this page: http://www.icetips.com/manuals/utilities/searchreplace_core.htm