Here you can find the source of inverter(String string)
public static String inverter(String string)
//package com.java2s; //License from project: Open Source License public class Main { public static String inverter(String string) { if (isEmpty(string)) { return null; }//from ww w. j a va 2 s.c o m StringBuilder inverter = new StringBuilder(); for (int i = string.length() - 1; i >= 0; i--) { inverter.append(string.charAt(i)); } return inverter.toString(); } public static boolean isEmpty(String string) { return string == null ? true : string.trim().length() > 0 ? false : true; } }