Hi all, I want to replace some characters in a string using code. Is there an existing function that does this replacement? I can’t use CONVERSTR because my characters to replace are double, and I want to change them into singles (e.g. Phisical → Fisical,…) Thanx
Not that I know of but here is one such function: ReplaceString(String : Text[250];FindWhat : Text[250];ReplaceWith : Text[250]) NewString : Text[250] WHILE STRPOS(String,FindWhat) > 0 DO String := DELSTR(String,STRPOS(String,FindWhat)) + ReplaceWith + COPYSTR(String,STRPOS(String,FindWhat) + STRLEN(FindWhat)); NewString := String;
You may have to change it for your specific case.
Thanx nelson!!!