• Home
  • Random
  • Log in
  • Settings
Donate Now If this site has been useful to you, please give today.
  • About Wikiversity
  • Disclaimers
Wikiversity

Template:Trim

  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]

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 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.

TemplateData for Trim

The template trims whitespace from a string.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
String1

The string to be trimmed of whitespace

Stringrequired
The above documentation is transcluded from Template:Trim/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikiversity.org/w/index.php?title=Template:Trim&oldid=2528281"
Last edited on 27 May 2023, at 07:21

Languages

    • Français
    • 한국어
    • 中文
    Wikiversity
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 27 May 2023, at 07:21.
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikiversity
    • Disclaimers
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop