テンプレート:Replace/doc

提供:Wikisource

第1引数に含まれる置換対象の文字列(第2引数)を全て別の文字列(第3引数)に置換するテンプレートです。

構文[編集]

{{replace |<文章>|<置換したい部分文字列>|<新しい部分文字列>[|count=n]}}

  • |count = nを指定した場合、n個目の置換対象まで置換します。ただし、|count = 1と指定する場合は代わりに{{Str rep}}を使用してください。

使用例[編集]

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

テンプレート:文字列処理テンプレート