Here you can find the source of rot13(String input)
public static final String rot13(String input)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .ja v a2s . c o m*/ * ROMAN */ public static final String rot13(String input) { char[] out = input.toCharArray(); int i = 0; for (char c : out) { if (c >= 'a' && c <= 'z') { c -= 'a'; c += 13; c %= 26; c += 'a'; } else if (c >= 'A' && c <= 'Z') { c -= 'A'; c += 13; c %= 26; c += 'A'; } else if (c >= '0' && c <= '9') { c -= '0'; c += 5; c %= 10; c += '0'; } out[i++] = c; } return new String(out); } }