A calculator for strings