Delphi Left Pad Function
Join the DZone community and get the full member experience.
Join For FreeLeft pad function
function LeftPad(PadString : string ; HowMany : integer ; PadValue : string): string;
var
Counter : integer;
x : integer;
NewString : string;
begin
Counter := HowMany - Length(PadString);
for x := 1 to Counter do
begin
NewString := NewString + PadValue;
end;
Result := NewString + PadString;
end;
Delphi (programming language)
Opinions expressed by DZone contributors are their own.
Comments