Support > General Discussions

REPLACE

(1/1)

John_M:
Hello; I am having trouble with REPLACE.
From the user guide:

REPLACE("alabama mama", "a","x",3,5)

will replace only three occurrences of string "a" starting at position 5. The result is "alabxmx mxma".
----------------
Have tried many variations, but have not been able to get it to work?

This should work, yes?

doda="qwhertyuhioplkjhgfdsah"
x="h"
y="m"
REPLACE(doda,x,y)

Where every occurrence of h is replaced with m. Thanks
---------
ok, I found out how to use it.

print REPLACE("alabama mama", "a","x",3,5)

will replace only three occurrences of string "a" starting at position 5.
The result "alabxmx mxma" is printed.
--------------
my example:
doda="qwhertyuhioplkjhgfdsah"
x="h"
y="m"
newdat=REPLACE(doda,x,y)
print REPLACE(doda,x,y)
print newdat

gives:
qwmertyumioplkjmgfdsam
qwmertyumioplkjmgfdsam

I am really glad this works as I need to filter
a few files.

Support:
So I can assume it's working for you and you just needed to talk about it with us? ;-)

John

Navigation

[0] Message Index

Go to full version