Here you can find the source of flipCase(final String s)
public static String flipCase(final String s)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { public static String flipCase(final String s) { final StringBuilder builder = new StringBuilder(s); for (int i = 0; i < s.length(); ++i) { char c = builder.charAt(i); if (Character.isUpperCase(c)) { c = Character.toLowerCase(c); } else if (Character.isLowerCase(c)) { c = Character.toUpperCase(c); }/* w w w . jav a 2 s. com*/ builder.setCharAt(i, c); } return builder.toString(); } }