List of utility methods to do String Reverse
int | compareVersion(String va, String vb) Compare version number, the format of version number should be X.X.X style. String[] vas = va.split("\\."); String[] vbs = vb.split("\\."); List<String> vaList = new ArrayList<String>(); for (int i = 0; i < vas.length; i++) { vaList.add(vas[i].trim().equals("") ? "0" : vas[i]); List<String> vbList = new ArrayList<String>(); for (int i = 0; i < vbs.length; i++) { ... |
String | getReverseShelfKey(String shelfkey) given a shelfkey (a lexicaly sortable call number), return the reverse shelf key - a sortable version of the call number that will give the reverse order (for getting "previous" call numbers in a list) StringBuilder resultBuf = new StringBuilder(reverseDefault); if (shelfkey != null && shelfkey.length() > 0) resultBuf.replace(0, shelfkey.length(), reverseAlphanum(shelfkey)); return resultBuf.toString(); |
String | reverse(String aPackage) reverse StringTokenizer tok = new StringTokenizer(aPackage, "."); String ans = tok.nextToken(); while (tok.hasMoreTokens()) { ans = tok.nextToken() + "." + ans; return ans; |
String | reverse(String s) Reverse a string return new StringBuilder(s).reverse().toString(); |
String | reverse(String text) reverse char[] chars = text.toCharArray(); ArrayList<Character> list = new ArrayList<>(); for (int i = chars.length - 1; i >= 0; i--) { list.add(chars[i]); int size = list.size(); chars = new char[size]; for (int i = 0; i < size; i++) { ... |
String | reverse(String word) reverse char[] chars = word.toCharArray(); int size = word.length(); for (int li = 0, ri = size - 1; li < ri; li++, ri--) { char swap = chars[li]; chars[li] = chars[ri]; chars[ri] = swap; return new String(chars); ... |
String | reverseCommaDelimitedString(final String string) Reverses a string which consists of comma-separated items. final List<String> items = new ArrayList<>(); final int string_len = string.length(); int index = 0; for (int i = 0; i < string_len; i++) { final char ch = string.charAt(i); if (ch == ',') { if (i > index) { items.add(string.substring(index, i).trim()); ... |
String | reverseDelimited(String str, char separatorChar) reverse Delimited if (str == null) { return null; String[] strs = split(str, separatorChar); reverseArray(strs); return join(strs, separatorChar); |
String | reverseUseSB(String str) reverse Use SB String result = new StringBuffer(str).reverse().toString(); return result; |