ScriptBasic
September 09, 2010, 12:18:28 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: REPLACE  (Read 1544 times)
John_M
Newbie
*
Posts: 7


« on: May 17, 2006, 12:42:53 AM »

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.
Logged
support
Administrator
*****
Posts: 271


« Reply #1 on: May 17, 2006, 04:20:49 PM »

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

John
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!