mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-08 14:52:42 +02:00
38 lines
550 B
ObjectPascal
38 lines
550 B
ObjectPascal
unit bug28861_unit1;
|
|
|
|
{$mode delphi}
|
|
|
|
interface
|
|
|
|
{ TStringHelper }
|
|
|
|
type
|
|
TStringHelper = record helper for string
|
|
private
|
|
function GetTheLength: Integer;
|
|
public
|
|
function Twice: string;
|
|
function Thrice: string;
|
|
property TheLength: Integer read GetTheLength;
|
|
end;
|
|
|
|
implementation
|
|
|
|
function TStringHelper.GetTheLength: Integer;
|
|
begin
|
|
Result := Length(Self)
|
|
end;
|
|
|
|
function TStringHelper.Twice: string;
|
|
begin
|
|
Result := Self + Self;
|
|
end;
|
|
|
|
function TStringHelper.Thrice: string;
|
|
begin
|
|
Result := Self + Self + Self;
|
|
end;
|
|
|
|
end.
|
|
|