Jump to content

Template:Str rep/doc: Difference between revisions

From SeptemWiki
 
Line 2: Line 2:


=== Usage ===
=== Usage ===
<nowiki> {{Str rep|<string>|<find>|<replacewith>}} </nowiki>
<nowiki> {{Str rep|haystack|needle|pin}} </nowiki>


Returns <string> with the '''first''' occurrence of <find> replaced with <replacewith>.
Returns ''haystack'' with the '''first''' occurrence of ''needle'' replaced with ''pin''.


=== Example ===
=== Example ===

Latest revision as of 17:11, 9 April 2016


Usage

{{Str rep|haystack|needle|pin}}

Returns haystack with the first occurrence of needle replaced with pin.

Example

  • {{str rep|Dogs chase cats|chase|love}} = Script error: No such module "String".

See also

  • [[Template:Replace|Template:Tn]] - to replace all occurrences (Lua based)