Template:Pos/doc

This template returns a single character from the target string at position pos.

Parameters

 * target_string
 * The string to search


 * index_value
 * The index for the character to return

The first character has an index value of 1.

If one requests a negative value, this function will select a character by counting backwards from the end of the string. In other words pos = -1 is the same as asking for the last character.

A requested value of zero, or a value greater than the length of the string returns an error.

Examples

 * 1)   yields:
 * 2)   yields: