Template:Concat/doc
This is a documentation subpage for Template:Concat. It contains usage information, categories, and other content that is not part of the original template page. |
Wikitext
editThis Template:Concat contains:
{{{1|}}}{{{2|}}}{{{3|}}}...{{{150|}}}
Purpose
editThis template concatenates parameters 1 − 150, as far as defined.
Newlines and spaces are preserved in the "expansion", and rendered as usual.
Usage
edit{{Concat |data |data |... }}
or
{{Concat |number=data |number=data |... }}
The first form is not useful to apply directly; it can be useful in another template, e.g. Template:For. The second form sorts the data by parameter number, and removes duplicates: only the lastly defined value of a parameter counts; however, a defined value cannot be made undefined by any code later in the template call.
Examples
editCode | Result |
---|---|
{{Concat|}} | |
{{Concat|a}} | a |
"{{Concat| a |b |c| d
}}" |
" a b c d
" |
{{Concat|a|b|c}} | abc |
{{Concat|2=a|3=b|1=c}} | cab |
{{Concat|2=a|3=b|2=c}} | cb |
{{Concat|100=a|200=b}} | ab |
{{Concat|1=2=3|4=5=6}} | 2=35=6 |
{{for|, |call=concat and link to w:en:|pcv1=John_|pv=2||Lennon|Wayne}} | John_, John_Lennon, John_Wayne |
The last example uses Template:concat and link to w:en: containing "[[w:en:{{{1|}}}{{{2|}}}|{{{1|}}}{{{2|}}}]]
".