Template:Chop head and tail

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


{{Chop head and tail|<string>|<number-L>|<number-R>}}

This template removes <number-L> characters from the start and <number-R> from the end of <string>:

{{Chop head and tail|12345654321|3|2}} → 456543

A single parameter may be specified if <number-L> = <number-R>:

{{Chop head and tail|12345654321|3}} → 45654


This template can be used to "unlink" a linked parameter.

{{Chop head and tail|[[Einstein]]|2}} results in Einstein.

Because the default value of <number> is 2, this can be shortened to {{Chop head and tail|[[Einstein]]}}.


  • Expensive.
  • When used on strings with characters that carry a meaning in wiki-layout, this template will interpret the character as a layout instruction (bugzilla:12974). For example, {{Chop head and tail|[[123;456]]}} renders as
  • Supports the character set as defined by {{Str index/getchar}}, so that e.g. {{Chop head and tail|[[Nürnberg]]}} renders correctly as Nürnberg. However, not all characters are in this set.

See alsoEdit