Template:Array
Jump to navigation
Jump to search
This template uses Lua. Its code can be found under Module:Array. |
Divides a string into a formatted list of substrings.
- 1: arrayString - the input string, each item separated by
separator
. - 2: separator - the character or substring to split on.
- 3: format - the resulting format of each substring.
- 4: join (optional) - separator between each element to join. Default no separator.
{item}
is replaced with the item.{newline}
is replaced with a newline.{index}
is replaced with the index.
- dedupe (optional): set to 1 to remove duplicate items in the array
Examples
{{Array|1,2,3,4,5|,|*''{item}''{newline} }}
- 1
- 2
- 3
- 4
- 5
{{Array|1,2,2,2,3,4,5|,|*''{item}''{newline}|dedupe=1}}
- 1
- 2
- 3
- 4
- 5
{{Array|a&&b&&c&&d&&e|&&|{index}: {item}|, }}
1: a, 2: b, 3: c, 4: d, 5: e
The above documentation is transcluded from Template:Array/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories and interwikis to the /doc subpage. Subpages of this template.
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories and interwikis to the /doc subpage. Subpages of this template.