貌似删除"R"及后面一直到"-"?procedure TForm1.Button1Click(Sender: TObject);varstr : string;beginstr := dealstr('R','-','STC60254701R2341-003');end;function TForm1.dealstr(desstrbegin,desstrend, srcstr: string): string;vari,j: integer;beginResult := srcstr;i := pos(desstrbegin, srcstr);j := pos(desstrend, srcstr);if ((j>i)and (i>0)) thenbegin
delete(result, i, j-i);end;end; |