ExtensionMethods

Instead of declaring a full type section, individual extension methods can also be declared with the extension method keyword combo:

extension method Int32.ToHexadecimalString: String;

and implemented like this:

extension method Int32.ToHexadecimalString: String;
begin
  result := ToString("X");
end;

See Also