Advertisement
Golden_Rus

Extract int from string

Dec 22nd, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. function extractInt(str:string):integer;
  2. var tmp:string;
  3. begin
  4. for i:=1 to Length(str) do
  5. if str[i] in ['0'..'9'] then tmp:=tmp + String(str[i]);
  6. Result:=StrToInt(tmp);
  7. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement