Template:Chr/doc

The Template:Chr extracts a specified nth character from a string, even allowing for accented letters to be included in the string.

Usage

 * = Returns the n-th character of text.

Supports a larger character set, allowing the text to have accented letters. Returns an error message for unknown characters.

Examples

 * 0 → 0
 * 0 → 0
 * 0 → 0
 * 0 → 0
 * 0 → 0

The last example shows extraction of letter "b" with string length as 1. The prior example extracts a blank but considers the length as 0, for there are no characters. If surrounded by 2 other characters, then the length would be totalled as 3 characters:


 * 2 → 2
 * 2 → 2
 * 2 → 2
 * XX → XX

A string-length problem occurs when using template Str index any.