Template:Replace
Appearance
Script error: No such module "String".
Usage
Template:((replace|string|target|replacement[|count=n]}}
Returns string with the first n occurrences of target replaced with replacement. Omitting Template:Code will replace all occurrences. Space counts as a character if placed in any of the first three parameters.
Examples
{{replace|One two two three two four twotwo five|two|NINE}}
→ Script error: No such module "String".{{replace|One two two three two four twotwo five|two|NINE|count=2}}
→ Script error: No such module "String".
Space
{{replace|One-two two-three two-four twotwo-five|-|—}}
→ Script error: No such module "String".{{replace|One-two two-three two-four twotwo-five|- |—}}
→ Script error: No such module "String".
See also
- Template:Tl, which replaces only the first occurrence of a string.
Pages that use this Template
|
Templates that use this Template
|