reimplementing string performOperator