Java tutorial
//package com.java2s; public class Main { /** * * @param str * @return */ public static String strRev(String str) { StringBuffer sb = new StringBuffer(str); String newstr = sb.reverse().toString(); return newstr; } }