|
Pages: [1]
|
 |
|
Author
|
Topic: Can't remember the name of a rebol function (Read 440 times)
|
|
rebolnotes
|
Hi, I know there is a function in rebol that allow to do replace something between <% and %> but can't remember its name. Thanks 
|
|
|
|
|
Logged
|
|
|
|
|
notchent
|
If you know what you're searching for inside the <% %>, you could use the "replace" function. Otherwise, you could use "parse": rebol []
; to replace a specific string inside the characters:
code: "text1 <% replace this %> text3" replace code "<% replace this %>" "<% text2 %>" print code
; to replace everything between the special characters:
code: "text1 <% replace this %> text3" parse code [any [thru "<%" copy new to "%>" (replace code new " text2 ")] to end] print code halt
|
|
|
|
|
Logged
|
|
|
|
|
rebolnotes
|
Hi thanks for answering, but I don't know what I'm looking for and the function is not replace.
|
|
|
|
|
Logged
|
|
|
|
|
notchent
|
Then use the parse example: code: "text1 <% replace this %> text3" parse code [any [thru "<%" copy new to "%>" (replace code new " text2 ")] to end] print code That will do what you asked, but if it's not what you're looking for, you can find related functions at the bottom of any function page in the Rebol dictionary, such as this page for the "change" function: http://www.rebol.com/docs/words/wchange.html
|
|
|
|
« Last Edit: July 11, 2008, 01:32:07 PM by notchent »
|
Logged
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Pages: [1]
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
|