Java Utililty Methods String Reverse

List of utility methods to do String Reverse

Description

The list of methods to do String Reverse are organized into topic(s).

Method

intcompareVersion(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++) {
...
StringgetReverseShelfKey(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();
Stringreverse(String aPackage)
reverse
StringTokenizer tok = new StringTokenizer(aPackage, ".");
String ans = tok.nextToken();
while (tok.hasMoreTokens()) {
    ans = tok.nextToken() + "." + ans;
return ans;
Stringreverse(String s)
Reverse a string
return new StringBuilder(s).reverse().toString();
Stringreverse(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++) {
...
Stringreverse(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);
...
StringreverseCommaDelimitedString(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());
...
StringreverseDelimited(String str, char separatorChar)
reverse Delimited
if (str == null) {
    return null;
String[] strs = split(str, separatorChar);
reverseArray(strs);
return join(strs, separatorChar);
StringreverseUseSB(String str)
reverse Use SB
String result = new StringBuffer(str).reverse().toString();
return result;