[Turn on line numbering]arg template; var t, x, idx, out, new; // this only explodes single word templates template = template.explode("|"); out = []; for t in (template) { idx = "?" in t; if (idx) { t = t.strip("?"); new = t.subrange(1, idx - 1); out += [new]; for x in [idx .. t.length()] { new += t[x]; out += [new]; } } else { out += [t]; } } return out;
// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit