String calculator