Skip to content

Instantly share code, notes, and snippets.

@reinaldoacdc
Last active February 28, 2022 17:49
Show Gist options
  • Save reinaldoacdc/029eb88d68175c18f2b2 to your computer and use it in GitHub Desktop.
Save reinaldoacdc/029eb88d68175c18f2b2 to your computer and use it in GitHub Desktop.
String Classhelper
unit StringHelper;
interface
type
TStringHelper = record helper for string
function OnlyNumbers :String;
end;
implementation
function TStringHelper.OnlyNumbers: String;
var
I :Byte;
begin
for I := 1 To Length(Self) do
if Self[I] In ['0'..'9'] Then
Result := Result + Self[I];
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment