Template:For Each Unique

From Ludlow Family Wiki
Revision as of 10:04, 25 June 2015 by Dan (talk | contribs)
Jump to: navigation, search

Apply a template to each non-repeating element of a list. Elements that are the same as the preceding element are skipped. (Elements that are repeated after something else—e.g., "A, B, A"—will be repeated in the output. To get true deduplication, ensure that the list is sorted.)

  • First parameter: string to split
  • Second parameter: delimiter to search for; default is comma
  • Third parameter: replacement delimiter; default is the search delimiter, or comma+space if none
  • template: template to apply to each substring (string provided as first parameter; index in non-repeating list provided as index; param is provided as param)
  • param: extra parameter to pass to the template; default is empty