| This template uses Lua:
|
{{Title disambig text|Title (disambig)}}
If page title is of the form Title (disambig), this function will return disambig. If no parenthetical expression is present, returns an empty string.
- {{Title disambig text|Title (whatever)}} → whatever
- {{Title disambig text|[[Title (whatever)]]}} → whatever
String-handling templates (help page) |
---|
Substring (select chunk of string by its position) |
---|
| Select a substring based on starting and ending index counted in either direction.
| | Keep the first N characters of a string, or duplicate it to N characters.
| | Return all but the last N characters of a string.
| | Return the N-th character of a string.
|
| | Return substring starting at N-th character to end of string.
| | Return the last N characters of a string; or a given value if empty.
| | Return substring of given length starting at N-th character.
| |
|
|
Trimming (select/remove chunk of string by character type) |
---|
| Trim any leading or trailing whitespace
| | Trim down to the beginning letters.
| | Trim down to the beginning numbers.
| | Trim any leading or trailing square brackets.
| | Trim leading or trailing matching quotes.
| | Trim up to six instances of specified <prefix>.
|
| | Extract a short string from a long string.
| | Trim down to the first space.
| | Remove anything before the first space.
| | Trim down from the last space.
| | Remove anything after the last space.
| |
|
|
Select/remove specific item from string |
---|
| Removes wikilink brackets (wikicode); all or outer only.
| | Removes wikicode (formatting and brackets)
| | Trim off any parenthesis text at the end of a string (disambiguation).
| | Returns text in parentheses at the end of a string (disambiguation).
|
| | Returns the 3-or-4-digit year from a pagename, if any.
| | Returns the 4-digit decade from a pagename (e.g. "1740" from "Foo 1740s bar"), if any.
| | Returns any number from a pagename.
| | Removes "WikiProject" from a pagename.
| |
|
|
Insertion, replacement and length |
---|
| Repeat character string a specified number of times.
| | Returns the string, after replacing all occurrences of a specified string with another string.
| | Returns the string, after replacing the first occurrence of a specified string with another string.
| | Returns the string, after removing all characters that are not digits 0–9
| | Displays wikitext as plain text.
|
|
| Returns a string's length.
| | Check if a string is "longer or equally long" or "shorter" than a given length.
| | Check if a string is "shorter or equally long" or "longer" than a given length.
| | Check if a string is "not equal" or "equal" to a given length.
| |
|
|
Analysis and searching |
---|
| Check if a string starts or ends with a given string.
| | Returns the numerical location of a given string in a string.
| | Count the number of occurrences of a pattern within a string.
| | Match one or multiple patterns with a variety of possible outputs.
|
|
| Array item manipulation and retrieval.
| | Takes a noun and produces the appropriate indefinite article, based on whether the first letter is a vowel.
| | Returns optional string when given string is not found
| | Returns number when true, blank when not numeric.
| | Returns the number of letters that begin a string.
| | Returns the number of numbers that begin a string.
| |
|
|
Modules and built-in functions |
---|
|
|
|