title: Negative string index
body: <p>I am doing some kind of cipher in Java for schools homework. The task is to change the value of a certian char to a new one with a specific offset which is given by the user and has a range from negative numbers to positive numbers (alphabet).</p>
  
  <p>Now I have a problem with negative offsets. I have created a String with the Alphabet which helps to find the new char. For example: With the offset of <code>7</code> I got this: <code>encrypt(“TEST”) = “ALZA”</code>. So my code grabs the index of the string value and searches with this index in the alphabet string for the new char. Anyway when I now have the char <code>'E'</code> and a negative index i.e <code>'-7'</code> it will return the value of <code>-3</code> for the new index of the new char (I hope that makes sense). Since there is no char on index <code>'-3'</code> I get an error.</p>
  
  <p>So how can I access to the end of the string instead of going more and more into negative index numbers ?</p>