charcalc() improved to support entire string calculations