Help:Titleparts

Parser function #titleparts produces a subsequence of a sequence of up to 25 strings separated by slashes (if there are more than 24 slashes the excess slashes are treated as plain text belonging to the 25th string). Since it was designed for application to a page title the total string has to be a valid page title, otherwise this total string is returned. This means that the total amount of memory including that for the slashes is limited to 255 bytes and that some characters including rectangular brackets are not allowed. Also, on retrieval some changes to the canonical form occur; e.g., the first character of the first string in the original sequence is usually capitalized, see below.


 *   returns m strings starting from the nth.

For m = 0 (the default) all strings from the nth are returned. A negative value -m indicates that m strings should be removed from the right. The default of n is 1. For n = 0 the result is the same. A negative value -n indicates that the leftmost string in the result should be the nth string from the right.























Special considerations
Slashes are not allowed in the strings, except in the 25th string and in strings starting with ./ (see below), since they are used as separator. Unlike the pipes the slashes need not be explicit in the wikitext, they can be produced by expansion. This also means that the slash cannot be part of a string even with a technique like.

Some special results:


 * (a becomes A, as already seen above; space is preserved)
 * (space is preserved)
 * (t and b are capitalized
 * compare: (t is capitalized
 * (neither t nor a is capitalized)
 * (returns the substring before #)
 * (leading colon is removed)
 * (underscore is converted to space)
 * multiple consecutive spaces are converted to a single one)
 * multiple consecutive underscores are converted to a single space)

Not a valid page name:
 * compare
 * compare
 * compare

The changes in strings beyond the first are more limited:
 * (underscore is converted to space)
 * multiple consecutive spaces are converted to a single one)
 * multiple consecutive underscores are converted to a single space)