procedure TRtlForm.Button2Click(Sender: TObject); var sub, s2: string; i: integer; begin sub := '-'; s2 := '123-123'; i := Pos(sub, s2); //找到sub在s2中的位置 ShowMessage(IntToStr(i)); end;
procedure TRtlForm.Button2Click(Sender: TObject); var sub, s2: string; i: integer; begin sub := '-'; s2 := '123-123'; i := Pos(sub, s2); //找到sub在s2中的位置 ShowMessage(IntToStr(i)); end;