Difference between revisions of "Template:For Each Unique"
m (4 revisions imported: Initial import from smithfam) |
|
(No difference)
| |
Latest revision as of 19:14, 8 December 2015
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