Template:Trim/doc

From Wikimedia Foundation Governance Wiki
Revision as of 07:35, 1 June 2023 by GVarnum-WMF (talk | contribs) (1 revision imported from meta:Template:Trim/doc)

Removes spaces and newlines from the start and end.

Usage

Not needed for a named parameter (neither in the template call, nor in the template code). In a template call, even for an unnamed parameter it is usually easier to write it as a named parameter, by putting e.g. "1=" in front. Note however that this affects the numbering of the remaining unnamed parameters.

Also not needed for a parameter of a parser function, it is trimmed anyway.

Even in cases where spaces do not affect rendering, trimming can be useful in substitution to avoid clutter in the resulting wikitext.

Examples