Strings Delphi

Title: left/right-pad strings with a character?
function LeftPad(S: string; Ch: Char; Len: Integer): string;
var
RestLen: Integer;
begin
Result := S;
RestLen := Len - Length(s);
if RestLen then Exit;
Result := S + StringOfChar(Ch, RestLen);
end;
function RightPad(S: string; Ch: Char; Len: Integer): string;
var
RestLen: Integer;
begin
Result := S;
RestLen := Len - Length(s);
if RestLen then Exit;
Result := StringOfChar(Ch, RestLen) + S;
end;
{Beispiel / Example}
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text := Rightpad(Edit2.Text, '-', 30);
end;