function that pops out last character in a string in javascript.
function popstr (str) { return str.substring(0, str.length - 1); }