add string helper to convert to int

This commit is contained in:
Basile Burg 2016-07-08 02:34:30 +02:00
parent be6ea9d712
commit 9c50cfa789
1 changed files with 12 additions and 0 deletions

View File

@ -80,6 +80,8 @@ type
function dirExists: boolean;
function upperCase: string;
function length: integer;
function toIntNoExcept(default: integer = -1): integer;
function toInt: integer;
end;
(**
@ -430,6 +432,16 @@ begin
exit(system.length(self));
end;
function TStringHelper.toInt: integer;
begin
exit(strToInt(self));
end;
function TStringHelper.toIntNoExcept(default: integer = -1): integer;
begin
exit(StrToIntDef(self, default));
end;
procedure TProcessEx.Assign(aValue: TPersistent);
var
src: TProcess;