Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String caseConvert(String str)
- {
- StringBuffer buf = new StringBuffer();
- int length = str.length();
- for( int i = 0; i < length; i++)
- {
- char ch = str.charAt(i);
- if(Character.isUpperCase(ch))
- {
- buf.append(Character.toLowerCase(ch));
- }
- else
- {
- buf.append(Character.toUpperCase(ch));
- }
- }
- return buf.toString();
- }
Add Comment
Please, Sign In to add comment