ScriptBasic
February 09, 2012, 07:35:09 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Registration Disabled Send an e-mail to support @ scriptbasic.org to request a membership to this forum. (include desired forum name)
 
   Home   Wiki Help Search Login Register  
Pages: [1]
  Print  
Author Topic: REPLACE  (Read 1835 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: 369


« 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.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!