for i:=1 to length(str) do begin if not (str[i] in ['1'..'9']) then begin if str[i-1]='+' then delete(str, i-1, 1); end; end;