title: ROT-13 function in java?
body: <p>Is there already a <code>rot13()</code> and <code>unrot13()</code> implementation as part of one of the standard Java libraries?  Or do I have to write it myself and "reinvent the wheel"?</p>
  
  <p>It might look something like this:</p>
  
  <pre><code>int rot13 ( int c ) { 
    if ( (c &gt;= 'A') &amp;&amp; (c &lt;= 'Z') ) 
      c=(((c-'A')+13)%26)+'A';
  
    if ( (c &gt;= 'a') &amp;&amp; (c &lt;= 'z') )
      c=(((c-'a')+13)%26)+'a';
  
    return c; 
  }
  </code></pre>