var i:integer; str:string; a:integer; begin str:='E3052EAS00325'; for i:=Length(str) downto 1 do begin if not TryStrToInt(str[i],a) then begin Result:=i; break; end; end; end;
s := 'E3052EAS00325'; for i := length(s) downto 1 do begin if s[i] in ['0'..'9'] then continue else begin showmessage(inttostr(i)); break; end; end;
function GetCharIndex(const S: String): Integer; begin for Result := Length(S) downto 0 do begin if S[Result] in ['0'..'9'] then Continue else if S[Result] in ['a'..'z','A'..'Z'] then Exit else Break; end; Result := 0; end;procedure TForm1.FormCreate(Sender: TObject); begin ShowMessage(IntToStr(GetCharIndex('E3052EAS00325'))); end;
i:integer;
str:string;
a:integer;
begin
str:='E3052EAS00325';
for i:=Length(str) downto 1 do
begin
if not TryStrToInt(str[i],a) then
begin
Result:=i;
break;
end;
end;
end;
for i := length(s) downto 1 do
begin
if s[i] in ['0'..'9'] then
continue
else
begin
showmessage(inttostr(i));
break;
end;
end;
begin
for Result := Length(S) downto 0 do
begin
if S[Result] in ['0'..'9'] then
Continue
else if S[Result] in ['a'..'z','A'..'Z'] then
Exit
else
Break;
end;
Result := 0;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
ShowMessage(IntToStr(GetCharIndex('E3052EAS00325')));
end;