Possible Duplicate:
Generate all unique substrings for given string
Can anyone show me some light on how to solve this problem?
I have a string with some values like "{1,2,3}" each number separated by a comma Now with that string i need to generate a new string ... the new string should look like "{},{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}"
it’s pretty easy to do it on your head but i can’t figure out how to make it work with an algorithm Can anyone explain what i should do?
i don’t want codes, just an explanation on how to do it please. I'm thinking recursive... but i cant think of a way