@Kuba Whoops, you're right. f
takes a string and returns a list of strings (whose length depends in a complex way on the original string). That definitely matters. So, for instance, you could pretend f
is given by f[str_] := Append[StringReplaceList["hello", _ -> "X"], "Y"]
. I actually care about Union
Apply
ed to the thing I said before. For example:...
If mylist
is {"hi", "@", "kuba"}
, Union @@ Table[Map[Append[Drop[mylist, {i}], #] &, f[mylist[[i]]]], {i, Length[mylist]}]
outputs: {{"@", "kuba", "hX"}, {"@", "kuba", "Xi"}, {"@", "kuba", "Y"}, {"hi", "@", "kubX"}, {"hi", "@", "kuXa"}, {"hi", "@", "kXba"}, {"hi", "@", "Xuba"}, {"hi", "@", "Y"}, {"hi", "kuba", "X"}}
If this deserves making it's own question on the site, just let me know. I just wondered if someone could say "oh, that's Mapthread[,3]" or whatever.