1,357 bytes added
, 23:45, 19 December 2017
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
This template trims leading and trailing (but not interior) whitespace from a string. The string should be passed as the first unnamed parameter. The parameter must be named {{para|1}} if its value contains a <code>=</code> character.
You may substitute this template - that is, if used as <nowiki>{{trim}}</nowiki>, the resulting wikicode is "clean".
== Usage ==
<nowiki>{{trim|text}}</nowiki> = <var>text</var> with any leading or trailing whitespace removed.
== Examples ==
*"<nowiki>{{trim| abc}}</nowiki>" produces "{{trim| abc}}"
*"<nowiki>{{trim|xyz }}</nowiki>" produces "{{trim|xyz }}"
*"<nowiki>{{trim| abc xyz }}</nowiki>" produces "{{trim| abc xyz }}"
== Template data ==
<templatedata>
{
"description": "The template trims whitespace from a string.",
"params": {
"1": {
"label": "String",
"description": "The string to be trimmed of whitespace",
"type": "string",
"required": true
}
}
}
</templatedata>
{{String-handling templates |trim}}
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:String manipulation templates]]
[[Category:Parameter handling templates]]
</includeonly>