模板:Replace/doc
本文档是Template:Replace的文档子页面 (见页面自身)。 本页包含用法信息、分类和其他非原页面的内容。 |
使用Lua语言编写: |
参数及使用方法
编辑{{replace|字串|替換原文|替換為|count=替換次數}}
将字串填入模板参数1,输出时每出现一个参数2的指定原文,就会被替换为参数3的文字,可以用count参数限制替换次数(不指定则全部替换)。前三个参数对所有空格敏感。
范例
编辑{{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
空格
编辑{{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
参见
编辑
|