Bản mẫu:Chop head and tail

Bách khoa toàn thư mở Wikipedia
Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]

Cách sử dụng[sửa mã nguồn]

{{Chop head and tail|<string>|<number>}}

This template removes <number> characters from the start and end of <string>.

{{Chop head and tail|12345654321|3}} cho ra 45654.

Unlinking[sửa mã nguồn]

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

{{Chop head and tail|Einstein|2}} kết quả trong Einstein.

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

Giới hạn[sửa mã nguồn]

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

Xem thêm[sửa mã nguồn]