Regarding String manipulation

Posted by arav on Stack Overflow See other posts from Stack Overflow or by arav
Published on 2010-03-15T10:15:08Z Indexed on 2010/03/15 10:19 UTC
Read the original article Hit count: 689

Filed under:
|
|

I have a String str which can have list of values like below. I want the first letter in the string to be uppercase and if underscore appears in the string then i need to remove it and need to make the letter after it as upper case. The rest all letter i want it to be lower case.

""
"abc" 
"abc_def"
"Abc_def_Ghi12_abd"
"abc__de"
"_"
Output:
""
"Abc"
"AbcDef"
"AbcDefGhi12Abd"
"AbcDe"
""

© Stack Overflow or respective owner

Related posts about java

Related posts about string