You can use substring
function:
s.substring(0,s.length() - 2));
With the first 0
, you say to substring
that it has to start in the first character of your string and with the s.length() - 2
that it has to finish 2 characters before the String ends.
For more information about substring
function you can see here:
http://docs.oracle.com/javase/7/docs/api/java/lang/String.html