Changes
no edit summary
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
=== Usage ===
{{Tlx|Chop head and tail|<string>|<number>}}
This template removes <number> characters from the start and end of <string>.
: {{Tlx|Chop head and tail|12345654321|3}} gives {{Chop head and tail|12345654321|3}}.
==== Unlinking ====
This template can be used to "unlink" a linked parameter.
: {{Tlx|Chop head and tail|<nowiki>[[Einstein]]</nowiki>|2}} results in {{Chop head and tail|[[Einstein]]}}.
Because the default value of <number> is 2, this can be shortened to <code>{{Tlx|Chop head and tail|<nowiki>[[Einstein]]</nowiki>}}</code>.
=== Limitations ===
* 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, {{Tlx|Chop head and tail|<nowiki>[[123;456]]</nowiki>}} renders as<br />{{Chop head and tail|[[123;456]]}}
* Supports the character set as defined by {{tl|Str index/getchar}}, so that e.g. {{Tlx|Chop head and tail|<nowiki>[[Nürnberg]]</nowiki>}} renders correctly as {{Chop head and tail|[[Nürnberg]]|nocategory=true}}. However, not all characters are in this set.
===See also===
* {{tl|Unlink}}
{{String-handling templates |trim}}
<includeonly>
<!-- CATEGORIES BELOW THIS LINE, PLEASE: -->
[[Category:String manipulation templates]]
</includeonly>
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
=== Usage ===
{{Tlx|Chop head and tail|<string>|<number>}}
This template removes <number> characters from the start and end of <string>.
: {{Tlx|Chop head and tail|12345654321|3}} gives {{Chop head and tail|12345654321|3}}.
==== Unlinking ====
This template can be used to "unlink" a linked parameter.
: {{Tlx|Chop head and tail|<nowiki>[[Einstein]]</nowiki>|2}} results in {{Chop head and tail|[[Einstein]]}}.
Because the default value of <number> is 2, this can be shortened to <code>{{Tlx|Chop head and tail|<nowiki>[[Einstein]]</nowiki>}}</code>.
=== Limitations ===
* 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, {{Tlx|Chop head and tail|<nowiki>[[123;456]]</nowiki>}} renders as<br />{{Chop head and tail|[[123;456]]}}
* Supports the character set as defined by {{tl|Str index/getchar}}, so that e.g. {{Tlx|Chop head and tail|<nowiki>[[Nürnberg]]</nowiki>}} renders correctly as {{Chop head and tail|[[Nürnberg]]|nocategory=true}}. However, not all characters are in this set.
===See also===
* {{tl|Unlink}}
{{String-handling templates |trim}}
<includeonly>
<!-- CATEGORIES BELOW THIS LINE, PLEASE: -->
[[Category:String manipulation templates]]
</includeonly>