Template:Trim/doc: Difference between revisions
Jump to navigation
Jump to search
Randombell (talk | contribs) Created page with "{{Documentation subpage}} {{notice|This template is for trimming whitespace from strings. For the maintenance tag for images, see {{tl|trimming}}}} <!-- 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 WP:SUBS..." |
(No difference)
|
Latest revision as of 11:36, 19 August 2025
![]() | This is a documentation subpage for Template:Trim. It contains usage information, categories and other content that is not part of the original template page. |
![]() | This template is for trimming whitespace from strings. For the maintenance tag for images, see {{trimming}} |
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 |1=
if its value contains a =
character.
You may substitute this template—that is, if this template is used as {{subst:trim}}
, the resulting wikicode is "clean".
Usage
{{trim|text}}
= text with any leading or trailing whitespace removed.
Examples
- "
{{trim| abc}}
" produces "abc" - "
{{trim|xyz }}
" produces "xyz" - "
{{trim| abc xyz }}
" produces "abc xyz"
Template data
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Trim in articles based on its TemplateData.
TemplateData for Trim
The template trims whitespace from a string.
Parameter | Description | Type | Status | |
---|---|---|---|---|
String | 1 | The string to be trimmed of whitespace | String | required |
See also
- {{remove border}}
Lua error in Module:Navbox_with_collapsible_groups at line 6: attempt to call field 'with collapsible groups' (a nil value).