Template:Replace/doc
外观
| 此頁面是Template:Replace的Template文档。 此頁面可能包含了模板的使用說明、分類和其他内容。 |
| 此模板使用Lua语言: |
| 此Template文档被引用於約19,000個頁面。 為了避免造成大規模的影響,所有對此Template文档的編輯應先於沙盒、測試樣例或您的沙盒上測試。 測試後無誤的版本可以一次性地加入此Template文档中,但是修改前請務必於討論頁發起討論。 模板引用數量會自動更新。 |
參數及使用方法
[编辑]{{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
參見
[编辑]