Function StringPad(
InputStr,//tamamlanacak metin
FillChar: String;//tamamlama karakteri
StrLen: Integer;//uzunluk
StrJustify: Boolean): String;//tamamlama yönü
Var
TempFill: String;
Counter : Integer;
Begin
If Not (Length(InputStr) = StrLen) Then
Begin
If Length(InputStr) > StrLen Then
Begin
InputStr := SubStr(InputStr,1,StrLen);
End
Else
Begin
TempFill := '';
For Counter := 1 To StrLen-Length(InputStr) Do
Begin
TempFill := TempFill + FillChar;
End;
If StrJustify Then
Begin
InputStr := InputStr + TempFill;
End
Else
Begin
InputStr := TempFill + InputStr ;
End;
End;
End;
Result := InputStr;
End;