File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generate mixed cases of a word

 
Chethan Sharma
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How do I generate different cominations/ mixed cases of a word.

Eg: Test
TEST
TEst
TESt
TesT
...............

Please let me know .

Thanks,
Rams
 
Campbell Ritchie
Sheriff
Pie
Posts: 47273
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried changing your String to a char[] array and using the toLowerCase and toUpperCase methods of Character?
 
Chengwei Lee
Ranch Hand
Posts: 884
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could loop through the string, then for each character, you use a random generator to determine 1 or 0, then invoke the toLowerCase or toUpperCase method.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic