Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

code to find out all combinations

 
pavanb kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want code to find out all combinations of a word

for eg., if i have a word ABCD,then i have to find out all the combinations of this word like AB,AC,ABD.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this doesn't have anything specifically to do with Swing/JFC/AWT GUI stuff, I'm moving this post to the Java In General (Beginner) forum.

(In addition, this sounds suspiciously like a homework problem... and there's a difference between asking "Give me some suggestions/hints/pointers on how to do X" and "Post the code for X so I can cut and paste it into my homework". I'll give a hint... this involves loops and methods on the String class.)
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried up to this point? If you can give us an idea of where you would like to start, we can give feedback on where to go from there.
Layne
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's something to play around with - it will gaive all combos, including
single characters - modify to suit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic