Template:Trim punctuation

From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history


template icon Template documentation[view] [edit] [history] [purge]

Removes trialing punctuation from a string, while preserving trialing full stops. Also removes trailing spaces.

A typical use would be to remove trailing punctuation from names or other fields in citations.

Based on w:Template:Trim brackets

Usage[edit source]

Parameters:

  • text string

Characters removed[edit source]

  • ,
  • ;
  • spaces

Examples[edit source]

  • {{Trim punctuation|Smith,}} → Smith


  • {{Trim punctuation|Smith, J.}} → Smith, J.


  • {{Trim punctuation|Smith;}} → Smith


  • {{Trim punctuation|Smith,; }} → Smith


See also[edit source]