Template:Substr any/doc

< Template:Substr any
Revision as of 11:57, 21 March 2013 by Unknown user (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Mbox The substring Template:Substr_any extracts a substring of any characters, including accented letters, for a specified offset and length.

Usage

{{substr_any|text|offset|length}} = Substring of text starting at offset and containing length characters.

Offset from 0: the first character is numbered 0, and so on. The offset + length must be less than 50. Operates on an extended character set, including accented letters, if listed in Template:Str index/getchar.

Examples

{{substr_any|ABCDEFÄÖÜ |5|2}}  returns 2 letters "Template:Str ≥ lenTemplate:Str ≥ len".
{{substr_any|ABCDEFÄÖöÜüÑñß |8|4}}  returns the 4 characters starting at the 9th, "Template:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ len".
{{substr_any|XYZÈèĖėÇç |5|10}}  returns 4 letters "Template:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ lenTemplate:Str ≥ len" as too short for 10.

See also

Description of all string templates