String calculator implementation