Take the 2-minute tour ×  Since I'm not that familiar with java,
I don't know if there's a library somewhere that can do this
thing. If not, does anybody have any ideas how can this be
accomplished?  For instance I have a string "foo" and I want to
change the letter f with "f" and "a" so that the function
returns a list of strings with values "foo" and "aoo".  How to
deal with it when there's more of the same letters? "ffoo" into
"ffoo", "afoo", "faoo", "aaoo".  A better explanation:
(("a",("a","b)),("c",("c","d"))) Above is a group of characters
that need to be replaced with a character from the other
element. "a" is to be replaced with "a" and with "b". "c" is to
be replaced with "c" and "d".  If I have a string "ac", the
resulting combinations I need are: "ac" "bc" "ad" "bd"  If the
string is "IaJaKc", the resulting combinations are: "IaJaKc"
"IbJaKc" "IaJbKc" "IbJbKc" "IaJaKd" "IbJaKd" "IaJbKd" "IbJbKd"
The number of combinations can be calculated like this:
(replacements_of_a^letter_amount_a)*(replaceme