title: Pig 0.12.0 - extracting last two characters from a string
body: <p>I am using <code>CDH 5.5</code>, <code>Pig 0.12.0</code>. I have a <code>chararray</code> like this: <code>25 - 45</code> and I want to extract 25 and 45 out of this String.</p>
  
  <p>So, I did this:</p>
  
  <pre><code>minValue = (int)SUBSTRING(value,0,2);
  maxValue = ((int)SUBSTRING(value,6,2);
  </code></pre>
  
  <p>I am able to extract <code>minValue</code> but unable to extract the <code>maxValue</code> i.e. last two characters of the given String. </p>
  
  <p>Even I tried but this one is also not working.:</p>
  
  <pre><code>maxValue = ((int)SUBSTRING(value,-2,2);
  </code></pre>
  
  <p>Please let me know how to make this work.</p>