Difference between revisions of "TextReplace"
Line 2: | Line 2: | ||
[[Category:Doc Status D]] <!-- For Lumina use, do not change --> | [[Category:Doc Status D]] <!-- For Lumina use, do not change --> | ||
− | = TextReplace( text, pattern, subst'', all, caseInsensitive'' ) = | + | == TextReplace(text, pattern, subst'', all, caseInsensitive'') == |
− | Replaces the occurrence of | + | Replaces the occurrence of «pattern» in «text» by «subst». |
− | If | + | If «all» is omitted or <code>False</code>, replaces only the first occurrence. If «all» is <code>True</code>, replaces every occurrence of «pattern». |
− | If | + | If «caseInsensitive» is <code>True</code>, matches to «pattern» in a case-insensitive fashion. |
− | |||
− | |||
+ | == Library == | ||
Text Functions | Text Functions | ||
− | = Examples = | + | == Examples == |
+ | :<code>TextReplace("One for one and one for all", "one", "two") → </code> | ||
+ | :<code>"One for two and one for all"</code> | ||
− | + | :<code>TextReplace("One for one and one for all", "one", "two", caseInsensitive: True) →</code> | |
− | + | :<code>"two for one and one for all"</code> | |
− | + | ||
− | + | :<code>TextReplace("One for one and one for all", "one", "two", all: True) →</code> | |
− | + | :<code>"One for two and two for all"</code> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | :<code>TextReplace("One for one and one for all", "one", "two", all: True, caseInsensitive: True) →</code> | |
+ | :<code>"two for two and two for all"</code> | ||
− | * [[SelectText]] | + | == See Also == |
+ | * [[SelectText]] | ||
+ | * [[FindInText]] | ||
* [[Text Concatenation Operator: &]] | * [[Text Concatenation Operator: &]] | ||
* [[Chr]] | * [[Chr]] | ||
− | * [[TextTrim]] | + | * [[TextTrim]] |
− | * [[TextUpperCase]] | + | * [[SplitText]] |
+ | * [[JoinText]] | ||
+ | * [[TextUpperCase]] | ||
+ | * [[TextLowerCase]] | ||
* [[Regular Expressions]] | * [[Regular Expressions]] |
Revision as of 04:13, 14 January 2016
TextReplace(text, pattern, subst, all, caseInsensitive)
Replaces the occurrence of «pattern» in «text» by «subst».
If «all» is omitted or False
, replaces only the first occurrence. If «all» is True
, replaces every occurrence of «pattern».
If «caseInsensitive» is True
, matches to «pattern» in a case-insensitive fashion.
Library
Text Functions
Examples
TextReplace("One for one and one for all", "one", "two") →
"One for two and one for all"
TextReplace("One for one and one for all", "one", "two", caseInsensitive: True) →
"two for one and one for all"
TextReplace("One for one and one for all", "one", "two", all: True) →
"One for two and two for all"
TextReplace("One for one and one for all", "one", "two", all: True, caseInsensitive: True) →
"two for two and two for all"
See Also
Comments
Enable comment auto-refresher