I always have trouble remembering the correct arguments to the substring() method in order to delete the last character in a String.

Here is how you do it in Java: 

str =  str.substring(0, str.length()-1);

A similar statement in PHP:

$str = substr($str,0, strlen($str)-1); 

 

 More Java tips at http://www.ekcsoft.com/coding/java