Template:Str mid/doc

Usage
Characters in the source string are counted: the first is index 1, the last one is index length of string. The substring requested can be defined by these two indexes. Also, the substring can be defined by one index, and the substring length. The options are: It returns a part of the, starting with character on position index, length , last charater returned is end index.
 * efg &rarr; efg

If parameter 2 is omitted, start is from character 1:
 * Abcde &rarr; Abcde

If parameter 3 is omitted, the hole rest of the string is returned:
 * &rarr;

Counting from the end
By entering a negative value, the index is counted from the end:
 * stuv &rarr; stuv
 * &rarr;

Instead if substring length, use index for last character
By using parameter n, a number, you do not ask for substring length, but the last character (as counted from the start of the input string):
 * &rarr;

Spaces are kept
In the returned substring, spaces are kept: But the input string is trimmed:
 * > like < &rarr; > like <
 * > like < &rarr; > like <

Error messages
When the ranges (either param2 or the substring length) is out impossible in the string, an error is returned: The error can be supporesssed by using true. A blank (empty string) will be returned:
 * &rarr;
 * z &rarr; efghijklmnopqrstuvwxyz
 * z &rarr; efghijklmnopqrstuvwxyz

Error category

 * true switches off category adding.
 * error category sets the category to be added when in case of an error.
 * Default is Category:Errors reported by Module String.