Template:Array/doc

From MTG Wiki
Jump to navigation Jump to search
This is a template documentation subpage for Template:Array.
It contains usage information, categories, interlanguage links and other content that is not part of the original template page.

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