Skabelon:Replace/doc
Udseende
Dette er dokumentationsundersiden til Skabelon:Replace. Denne side indeholder information om brug, kategorier samt andet indhold, som ikke er en del af den oprindelige skabelonside. |
Denne skabelon bruger Lua: |
Usage
[rediger kildetekst]{{replace|string|target|replacement|count=n}}
Returns string with the first n occurrences of target replaced with replacement. Omitting count
will replace all occurrences. Space counts as a character if placed in any of the first three parameters.
Examples
[rediger kildetekst]{{replace|One two two three two four twotwo five|two|NINE}}
→ One NINE NINE three NINE four NINENINE five{{replace|One two two three two four twotwo five|two|NINE|count=2}}
→ One NINE NINE three two four twotwo five
Space
[rediger kildetekst]{{replace|One-two two-three two-four twotwo-five|-|—}}
→ One—two two—three two—four twotwo—five{{replace|One-two two-three two-four twotwo-five|- |—}}
→ One-two two-three two-four twotwo-five
See also
[rediger kildetekst]- {{str rep}}, which replaces only the first occurrence of a string.