模板:Replace/doc

来自决策链云智库
< 模板:Replace
Zeroclanzhang讨论 | 贡献2023年7月21日 (五) 20:39的版本 (创建页面,内容为“{{Documentation}} ;Usage <code>{{t|replace |''string'' |''target'' |''replacement''|''count''}}</code> Returns ''string'' with the first ''n'' occurrences of ''target'' replaced with ''replacement''. Omitting <code>count</code> will replace all occurrences. ;Examples * <code><nowiki>{{replace |One two two three two four twotwo five |two |NINE}}</nowiki></code> → {{replace|One two two three two four twotwo five|two|NINE}} * <code><nowiki>{{replace |One two t…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
Usage

{{replace |<string >|<target >|<replacement>|<count>}}

Returns string with the first n occurrences of target replaced with replacement. Omitting count will replace all occurrences.

Examples
  • {{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