Changes
Remove note about Template:Str index/getchar, no longer applies since converted to use Module:String. Document "sep" parameter. Add note about using "1=" when string may contain an equals sign. Update usage and examples.
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE-->
{{High-use|23817}}
{{Lua|Module:String}}
This template removes the first word of the first parameter. Use {{para|1}} for the first parameter if the string may contain an [[equals sign]] (=). By default, words are delimited by spaces, but the optional parameter {{para|sep}} can set the separator to any character.
==Usage==
One parameter (space as separator):
* <code>'''{{{{BASEPAGENAME}}|'''<var>string</var>'''}}'''</code>
* <code>'''{{{{BASEPAGENAME}}|1='''<var>string</var>'''}}'''</code>
Two parameters (user-defined character as separator):
* <code>'''{{{{BASEPAGENAME}}|'''<var>string</var>'''|sep='''<var>character</var>'''}}'''</code>
* <code>'''{{{{BASEPAGENAME}}|1='''<var>string</var>'''|sep='''<var>character</var>'''}}'''</code>
==Examples==
* {{tlc|{{BASEPAGENAME}}|Fôo bår bàz}} → {{{{BASEPAGENAME}}|Fôo bår bàz}}
* {{tlc|{{BASEPAGENAME}}| Fôo bår bàz }} → {{{{BASEPAGENAME}}| Fôo bår bàz }}
* {{tlc|{{BASEPAGENAME}}| a b }} → {{{{BASEPAGENAME}}| a b }}
* {{tlc|{{BASEPAGENAME}}|Fôo-bår}} → {{{{BASEPAGENAME}}|Fôo-bår}}
* {{tlc|{{BASEPAGENAME}}|Fôo-bår bàz}} → {{{{BASEPAGENAME}}|Fôo-bår bàz}}
* <code>{{{{BASEPAGENAME}}|Fôo-bår bàz|sep=-}}</code> → {{{{BASEPAGENAME}}|Fôo-bår bàz|sep=-}}
* <code>{{{{BASEPAGENAME}}|34,000,500|sep=,}}</code> → {{{{BASEPAGENAME}}|34,000,500|sep=,}}
* <code>{{{{BASEPAGENAME}}|Hear ye, users|sep=,}}</code> → {{{{BASEPAGENAME}}|Hear ye, users|sep=,}}
* <code>{{{{BASEPAGENAME}}|1=len = a+b|sep==}}</code> → {{{{BASEPAGENAME}}|1=len = a+b|sep==}}
==See also==
{{String-handling templates |trim}}
<includeonly>
{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!----CATEGORIES BELOW THIS LINE, PLEASE:---->
[[Category:String manipulation templates]]
}}
</includeonly>
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE-->
{{High-use|23817}}
{{Lua|Module:String}}
This template removes the first word of the first parameter. Use {{para|1}} for the first parameter if the string may contain an [[equals sign]] (=). By default, words are delimited by spaces, but the optional parameter {{para|sep}} can set the separator to any character.
==Usage==
One parameter (space as separator):
* <code>'''{{{{BASEPAGENAME}}|'''<var>string</var>'''}}'''</code>
* <code>'''{{{{BASEPAGENAME}}|1='''<var>string</var>'''}}'''</code>
Two parameters (user-defined character as separator):
* <code>'''{{{{BASEPAGENAME}}|'''<var>string</var>'''|sep='''<var>character</var>'''}}'''</code>
* <code>'''{{{{BASEPAGENAME}}|1='''<var>string</var>'''|sep='''<var>character</var>'''}}'''</code>
==Examples==
* {{tlc|{{BASEPAGENAME}}|Fôo bår bàz}} → {{{{BASEPAGENAME}}|Fôo bår bàz}}
* {{tlc|{{BASEPAGENAME}}| Fôo bår bàz }} → {{{{BASEPAGENAME}}| Fôo bår bàz }}
* {{tlc|{{BASEPAGENAME}}| a b }} → {{{{BASEPAGENAME}}| a b }}
* {{tlc|{{BASEPAGENAME}}|Fôo-bår}} → {{{{BASEPAGENAME}}|Fôo-bår}}
* {{tlc|{{BASEPAGENAME}}|Fôo-bår bàz}} → {{{{BASEPAGENAME}}|Fôo-bår bàz}}
* <code>{{{{BASEPAGENAME}}|Fôo-bår bàz|sep=-}}</code> → {{{{BASEPAGENAME}}|Fôo-bår bàz|sep=-}}
* <code>{{{{BASEPAGENAME}}|34,000,500|sep=,}}</code> → {{{{BASEPAGENAME}}|34,000,500|sep=,}}
* <code>{{{{BASEPAGENAME}}|Hear ye, users|sep=,}}</code> → {{{{BASEPAGENAME}}|Hear ye, users|sep=,}}
* <code>{{{{BASEPAGENAME}}|1=len = a+b|sep==}}</code> → {{{{BASEPAGENAME}}|1=len = a+b|sep==}}
==See also==
{{String-handling templates |trim}}
<includeonly>
{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!----CATEGORIES BELOW THIS LINE, PLEASE:---->
[[Category:String manipulation templates]]
}}
</includeonly>