Changes

From SME Server
Jump to navigationJump to search
1,357 bytes added ,  23:45, 19 December 2017
Created page with "<!-- 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 shou..."
<!-- 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&nbsp;}}</nowiki>" produces "{{trim|xyz }}"
*"<nowiki>{{trim| abc xyz&nbsp;}}</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>
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,254

edits

Navigation menu