Replace |
|
Description
Replaces all instances of a specified string with a new string.
Arguments
1.Replace - Name of the Macro.
2.Base String - The base string that will be used for the macro.
3.Search String - A substring that will be used to search the base string.
4.Replace String - A string that will replace any instance where the search string is found.
Examples
[Replace|Jim|J|T]
Returns "Tim".
[Replace|This is a test|is|was]
Returns "Thwas was a test".
[Replace|This is a test| is| was]
Returns "This was a test".
[Replace|[Attribute|Superhero]|Bat|Spider]
If the attribute is defined as Batman it returns "Spiderman". If the attribute is defined as something else it returns that value. If the attribute is not defined it returns a blank value.
[Replace|THIS IS A TEST OF THE SYSTEM|a|the]
Returns "THIS IS A TEST OF THE SYSTEM" because the search and replace is case sensitive.
[Replace|[Lower|THIS IS A TEST OF THE SYSTEM]|a|the]
Returns "this is the test of the system".
Notes
The comparison of the search string to the base string is case sensitive. Whitespace is preserved when both searching and replacing the string. If the replacement value is not found the base string is returned unchanged.
Copyright © 2024 pasUNITY, Inc.
Send comments on this topic.
Created with an evaluation copy of HelpSmith.
To remove this notice, you should purchase the full version of the product.