public static synchronized String rot13(String input){
  StringBuffer output=new StringBuffer();
  if (input != null) {
    for (int i=0; i < input.length(); i++) {
      char inChar=input.charAt(i);
      if ((inChar >= 'A') & (inChar <= 'Z')) {
        inChar+=13;
        if (inChar > 'Z') {
          inChar-=26;
        }
      }
      if ((inChar >= 'a') & (inChar <= 'z')) {
        inChar+=13;
        if (inChar > 'z') {
          inChar-=26;
        }
      }
      output.append(inChar);
    }
  }
  return output.toString();
}

public static synchronized String rot13 ( String input ) { StringBuffer output = new StringBuffer ( ) ; if ( input != null ) { for ( int i = 0 ; i < input . length ( ) ; i ++ ) { char inChar = input . charAt ( i ) ; if ( ( inChar >= 'A' ) & ( inChar <= 'Z' ) ) { inChar += 13 ; if ( inChar > 'Z' ) { inChar -= 26 ; } } if ( ( inChar >= 'a' ) & ( inChar <= 'z' ) ) { inChar += 13 ; if ( inChar > 'z' ) { inChar -= 26 ; } } output . append ( inChar ) ; } } return output . toString ( ) ; }
description of the method
