![]()
|
|
Home PUBz Grafx Pax Tips & Trix Neo-Linx Neo-Talk NeoDezign Filez Search NeoDezign
|
You can use the built-in functions of NeoBook to Find & Replace text within a String. It can be a bit tricky but with some careful scripting it can be done. Normally, you would use SearchStr to scan a string. The trick is to use SubStr instead. By increment these postions forward at the same time while reading the space between the postions with each increment. In this example I am going to scan the following [textstring]... "NeoBook allows just about anyone to produce royalty-free..." ...[find] "just about anyone"... ...and
I am going to [replace]
it with "absolutley everyone"!
First, I begin by determining the length of the string that I want to find... "just about anyone" is 17 characters long. Store this LEN in [findlen] Next, "prime the pump" for a While loop SetVar "[a]" "1" Begin
scanning across [textstring] using SubStr
Action Script: SetVar
"[a]" "1"
While
"[a]" "<=" "[textlen]"
If "[find]"
"=" "[scan]"
Math "[a]+1" "" "[a]" EndWhile :END
A ...
|
|
|