in reply to Permutations question

It's not quite the same, but you might want to see String expansion script too.