Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

case convertor

 
Harathi Rao
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i have a very simple requirement given a string in any case i have to change it to a specific format like...

give string : callable or CaLLable or CALLABLE ie; given any case

i should get the output as :

new string: Callable

is there any method provided by java for this.


Thanks in Advance,
Harathi
 
madhup narain
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if your requirement is such that you need the first character as "CAPS" and the rest in "SMALL" then youd need to use the following

thanks
 
Harathi Rao
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much...
 
Hari Sundharesan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wat a fool
 
madhup narain
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that Hari Sundharesan has a better solution ? ? ?
 
Hari Sundharesan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yo madhup not mocking at u dude..take a chill pill..
 
Junilu Lacar
Bartender
Pie
Posts: 7784
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Hari Sundharesan:
wat a fool




Hari, your posts must NOT go against our "be friendly" rule that all forum members are required to follow. Everyone has to start somewhere and some will have a harder time than others. In the future, please refrain from posting anything other than constructive comments and/or questions.

Thanks for your cooperation.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic