title: Shift character in Alphabet
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8981296/rot-13-function-in-java">ROT-13 function in java?</a>  </p>
  </blockquote>
  
  
  
  <p>I have to shift all char from a string 13 places in the alphabet</p>
  
  <pre><code>private static String encode(String line) {
      char[] toEncode = line.toCharArray();
      for (int i = 0; i &lt; toEncode.length; i++) {
          if (Character.isLetter(toEncode[i])) {
              toEncode[i] += 13;
          }
      }
      line = String.valueOf(toEncode);
      return line;
  }
  </code></pre>
  
  <p>The Problem is that for example 'z' get to a ?. How can I solve that?</p>
  
  <p>Thx for help.</p>