Error getting tags :
error 404Error getting tags :
error 404 replace | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
replace
Basics
Expander triangle
Type
Command
Syntax
replace oldString with newString in container
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Replaces text in a container with other text.
Examples

replace "A" with "N" in thisVariable -- changes all As to Ns
replace return with empty in field 1 -- runs lines together
replace somethingOld with "\" in it
replace ".com" with somethingNew in URL "file:stuff.txt"

Additional Comments
Expander triangle

Use the replace command to replace all instances of one string with another string.

Parameters:

The oldString is any expression that evaluates to a string, and specifies the text to replace.

The newString is any expression that evaluates to a string, and specifies the text to replace the oldString with.

The container is a field, button, or variable, or the message box.

Comments:

The replace command is faster than the replaceText function, but does not support regular expressions: you can replace only an exact string of text.

Important! You can use the replacecommand on a field, but doing so removes any formatting (fonts, styles, colors, and sizes) in the field. To work around this limitation, use the field'shtmlText property as the source for replacement instead of using the field itself as the source:

get the htmlText of field "Stuff"

replace "old" with "new" in it

set the htmlText of field "Stuff" to it

User Comments
Expander triangle