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 character returned is end index.
 * &rarr; efg

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

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

Counting from the end
By entering a negative value, the index is counted from the end:
 * &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:
 * &rarr; > 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 suppressed by using true. A blank (empty string) will be returned:
 * &rarr;
 * &rarr; efghijklmnopqrstuvwxyz
 * &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.