List of utility methods to do String Case Insert
String | invert(final String s) invert char[] cs = s.toCharArray(); char[] result = new char[s.length()]; int j = 0; int i = s.length() - 1; while (i >= 0) { result[j++] = cs[i--]; return new String(result); ... |
String | invert(String s) invert StringBuilder sb = new StringBuilder(s.length()); for (int i = s.length() - 1; i >= 0; i--) { sb.append(s.charAt(i)); return sb.toString(); |
String | invertCase(String line) invert Case char[] chars = line.toCharArray(); char c; boolean changed = false; for (int i = 0; i < chars.length; i++) { c = chars[i]; if (Character.isLowerCase(c)) { chars[i] = Character.toUpperCase(c); changed = true; ... |
String | invertCase(String str) invert Case int strLen; if (str == null || (strLen = str.length()) == 0) { return str; StringBuilder builder = new StringBuilder(strLen); char ch = 0; for (int i = 0; i < strLen; i++) { ch = str.charAt(i); ... |
String | invertDate(String sDate) invert Date String retVal = sDate; if (sDate != null) { if (sDate.length() == 6) { retVal = sDate.substring(4, 6) + sDate.substring(2, 4) + sDate.substring(0, 2); } else { retVal = sDate.substring(4, 8) + sDate.substring(2, 4) + sDate.substring(0, 2); return retVal; |
String | inverter(String str) inverter return new StringBuilder(str).reverse().toString(); |
String | inverter(String string) inverter if (isEmpty(string)) { return null; StringBuilder inverter = new StringBuilder(); for (int i = string.length() - 1; i >= 0; i--) { inverter.append(string.charAt(i)); return inverter.toString(); ... |
String | inverterString(String palavra) inverter String if (isEmpty(palavra)) return ""; String[] letras = palavra.split(""); int ultimoValor = letras.length - 1; StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i <= ultimoValor; i++) { stringBuilder.append(letras[ultimoValor - i]); return stringBuilder.toString(); |
String | invertHostName(String hostNameIn) invert Host Name StringBuffer hostNameOut = new StringBuffer(); char tokens[] = hostNameIn.toCharArray(); int lastScanStart = hostNameIn.length() - 1; int currentIndex = lastScanStart; while (currentIndex != -1) { if (tokens[currentIndex] == '.') { if (lastScanStart - currentIndex != 0) { hostNameOut.append(tokens, currentIndex + 1, lastScanStart - currentIndex); ... |
String | invertKanaCase(String result) Swap hiragana and katakana StringBuffer foldedStringBuffer = new StringBuffer(result); int length = foldedStringBuffer.length(); for (int i = 0; i < length; i++) { char character = foldedStringBuffer.charAt(i); if ((character >= 0x30a1) && (character < 0x30f4)) { foldedStringBuffer.setCharAt(i, (char) (character - 96)); } else if ((character >= 0x3041) && (character < 0x3094)) { foldedStringBuffer.setCharAt(i, (char) (character + 96)); ... |