Template
:
String-handling templates
From HandWiki Stage
Jump to navigation
Jump to search
v
t
e
String-handling templates
(help page)
Substring (select chunk of string by its position)
Template:Tl
Select a substring based on starting and ending index counted in either direction.
Template:Tl
Keep the first N characters of a string, or duplicate it to N characters.
Template:Tl
Return all but the last N characters of a string.
Template:Tl
Return the N-th character of a string.
Template:Tl
Return substring starting at N-th character to end of string.
Template:Tl
Return the last N characters of a string; or a given value if empty.
Template:Tl
Return substring of given length starting at N-th character.
Trimming (select/remove chunk of string by character type)
Template:Tl
Trim any leading or trailing whitespace
Template:Tl
Trim down to the beginning letters.
Template:Tl
Trim down to the beginning numbers.
Template:Tl
Trim any leading or trailing square brackets.
Template:Tl
Trim leading or trailing matching quotes.
Template:Tl
Trim up to six instances of specified <prefix>.
Template:Tl
Extract a short string from a long string.
Template:Tl
Trim down to the first space.
Template:Tl
Remove anything before the first space.
Template:Tl
Trim down from the last space.
Template:Tl
Remove anything after the last space.
Select/remove specific item from string
Template:Tl
,
Template:Tl
Removes wikilink brackets (wikicode);
all
or
outer only
.
Template:Tl
Removes wikicode (formatting and brackets)
Template:Tl
Trim off any parenthesis text at the end of a string (disambiguation).
Template:Tl
Returns text in parentheses at the end of a string (disambiguation).
Template:Tl
Returns the 3-or-4-digit year from a pagename, if any.
Template:Tl
Returns the 4-digit decade from a pagename (e.g. "1740" from "Foo 1740s bar"), if any.
Template:Tl
Returns any number from a pagename.
Template:Tl
Removes "WikiProject" from a pagename.
Insertion, replacement, and length
Template:Tl
Repeat character string a specified number of times.
Template:Tl
Returns the string, after replacing
all
occurrences of a specified string with another string.
Template:Tl
Returns the string, after replacing the first occurrence of a specified string with another string.
Template:Tl
Returns the string, after removing all characters that are not digits 0–9
Template:Tl
Displays wikitext as plain text.
Template:Tl
Returns a string's length.
Template:Tl
Check if a string is "longer or equally long" or "shorter" than a given length.
Template:Tl
Check if a string is "shorter or equally long" or "longer" than a given length.
Template:Tl
Check if a string is "not equal" or "equal" to a given length.
Analysis and searching
Template:Tl
Template:Tl
Check if a string starts or ends with a given string.
Template:Tl
,
Template:Tl
Returns the numerical location of a given string in a string.
Template:Tl
Count the number of occurrences of a pattern within a string.
Template:Tl
Array item manipulation and retrieval.
Template:Tl
Takes a noun and produces the appropriate indefinite article, based on whether the first letter is a vowel.
Template:Tl
Returns optional string when given string is not found
Template:Tl
Returns number when true, blank when not numeric.
Template:Tl
Returns the number of letters that begin a string.
Template:Tl
Returns the number of numbers that begin a string.
Modules and built-in functions
Module:String
,
Module:String2
,
Module:Ustring
,
Module:Text
,
wikitext handling
: modules that together contain most necessary string functions.
Magic words
: About
{{padleft:|}}
,
{{lc:|}}
,
{{formatnum:|}}
etc.
ParserFunctions
: About
{{#titleparts:|}}, {{#expr:|}}, {{#ifeq:|}},
etc.
Category:String manipulation templates
Commons
MediaWiki
Meta-Wiki
Wikidata
Category:Modules that manipulate strings
Template documentation
[
create
]
Editors can experiment in this template's sandbox
(
create
|
mirror
)
and testcases
(
create
)
pages.
Please add categories to the
/doc
subpage.
Subpages of this template
.
Navigation menu
Personal tools
Log in
Namespaces
Template
Discussion
English
Views
Read
View source
View history
More
Search
Navigation
Main page
Add a new article
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Printable version
Permanent link
Page information