title: The most efficient way to decipher some text
body: <p>I am developing a small application where I am given some string <em>"MRUGDQ"</em> and a shift value 3 for example. Then I shift each letter to left by 3 and the result would be <em>"JORDAN"</em>. For instance <code>M</code> would be replaced by <code>J</code> and <code>R</code> would be replaced by <code>O</code> and so on.</p>
  
  <p>So now this is the approach I was thinking of using, but I was wondering if this is efficient and can I improve my solution?</p>
  
  <p>Assumptions I make:<br>
  I am assuming my string will be either capital A to Z letter or small a to z letter and therefore the ascii range is from 65 to 90 and 97 to 122 respectively.</p>
  
  <p>Pesudo Code</p>
  
  <ol>
  <li>get ascii value of char
  (assume char happens to be between the capital letter range)</li>
  <li><p>add the shift value to the char ascii value</p></li>
  <li><pre><code>if new ascii value &lt;= 90
      replace old letter by new letter
  else
      int diff = new ascii value - 90
      while (new ascii value &lt;= 90) {
          decrement diff value by 1
          increment new ascii value by 1
      }
      add remaining diff to 65 and set that as new ascii value
  replace old letter by new letter
  </code></pre></li>
  <li>Do that for each letter in the string.</li>
  </ol>
  
  <p>Please let me know if my approach is correct or if I can be more efficient.</p>