Template:Str rep/doc: Difference between revisions
Appearance
Line 2: | Line 2: | ||
=== Usage === | === Usage === | ||
<nowiki> {{Str rep| | <nowiki> {{Str rep|haystack|needle|pin}} </nowiki> | ||
Returns | Returns ''haystack'' with the '''first''' occurrence of ''needle'' replaced with ''pin''. | ||
=== Example === | === Example === |
Latest revision as of 17:11, 9 April 2016
![]() |
This is a metatemplate; that is, a template that will rarely be used directly in articles, but rather used in other templates which will be used directly. |
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)