Difference between revisions of "TextReplace"

m (adding doc status category stub page)
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 )
+
= TextReplace( text, pattern, subst'', all, caseInsensitive'' ) =
  
{{stub}}
+
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 =
 +
 
 +
{| border="0"
 +
|[[TextReplace]]("One for one and one for all", "one", "two")
 +
|&rarr;||"One for two and one for all"
 +
|-
 +
|[[TextReplace]]("One for one and one for all", "one", "two", caseInsensitive:True)
 +
|&rarr;||"two for one and one for all"
 +
|-
 +
|[[TextReplace]]("One for one and one for all", "one", "two", all:True)
 +
|&rarr;||"One for two and two for all"
 +
|-
 +
|[[TextReplace]]("One for one and one for all", "one", "two", all:True, caseInsensitive:True)
 +
|&rarr;||"two for two and two for all"
 +
|}
 +
 
 +
= See Also =
 +
 
 +
* [[SelectText]], [[FindInText]]
 +
* [[Text Concatenation Operator: &]]
 +
* [[Chr]]
 +
* [[TextTrim]], [[SplitText]], [[JoinText]]
 +
* [[TextUpperCase]], [[TextLowerCase]]

Revision as of 00:26, 29 September 2008


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


You are not allowed to post comments.