From BibleStrength

Template:Documentation subpage Template:Lua



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.


  • {{replace|One two two three two four twotwo five|two|NINE}}Script error: No such module "String".
  • {{replace|One two two three two four twotwo five|two|NINE|count=2}}Script error: No such module "String".


  • {{replace|One-two two-three two-four twotwo-five|-|—}}Script error: No such module "String".
  • {{replace|One-two two-three two-four twotwo-five|- |—}}Script error: No such module "String".

See also

  • {{str rep}}, which replaces only the first occurrence of a string.

Template:Navbox with collapsible groups