` String replacement function (Peter Hermansen ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: String replacement function
2007-09-28 -- Peter Hermansen
 
STRPOS! I've written a class with a few text manipulating methods. Here's the one you need. You can turn it into a function if you don't want to do the class thing. EDFuncClass.ReplaceAll Procedure(STRING pOldStr, STRING pNewStr, STRING pText) ! Replaces all occurencies of pOldStr in pText with pNewStr X LONG,Auto Code loop X = STRPOS(pText,pOldStr,True) if X pText = pText[1 : X-1] & Clip(pNewStr) & pText[X + LEN(Clip(pOldStr)) : LEN(Clip(pText))] else BREAK end end RETURN(pText)


Today is April 27, 2024, 2:28 pm
This article has been viewed 35114 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: