Here you can find the source of rot13(String s)
public static String rot13(String s)
//package com.java2s; /*/*from w w w . j av a2 s. c om*/ * Copyright (c) 2008-2015 Geode Systems LLC * This Software is licensed under the Geode Systems RAMADDA License available in the source distribution in the file * ramadda_license.txt. The above copyright notice shall be included in all copies or substantial portions of the Software. */ public class Main { /** */ public static String rot13(String s) { StringBuilder sb = new StringBuilder(); int offset = 13; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if ((c >= 'a') && (c <= 'm')) { c += offset; } else if ((c >= 'A') && (c <= 'M')) { c += offset; } else if ((c >= 'n') && (c <= 'z')) { c -= offset; } else if ((c >= 'N') && (c <= 'Z')) { c -= offset; } sb.append(c); } return sb.toString(); } /** * _more_ * * @param sb _more_ * @param s _more_ * * @return _more_ */ public static Appendable append(Appendable sb, String s) { try { sb.append(s); return sb; } catch (java.io.IOException ioe) { throw new RuntimeException(ioe); } } /** * _more_ * * @param o _more_ * * @return _more_ */ public static String toString(Object o) { if (o == null) { return ""; } return o.toString(); } }