strPadC fix
This commit is contained in:
parent
6dc66831f6
commit
35f46bbc16
|
@ -53,6 +53,13 @@ Var
|
||||||
Space : Byte;
|
Space : Byte;
|
||||||
Temp : Byte;
|
Temp : Byte;
|
||||||
Begin
|
Begin
|
||||||
|
If Length(Str) > Len Then Begin
|
||||||
|
Str[0] := Chr(Len);
|
||||||
|
Result := Str;
|
||||||
|
|
||||||
|
Exit;
|
||||||
|
End;
|
||||||
|
|
||||||
Space := (Len - Length(Str)) DIV 2;
|
Space := (Len - Length(Str)) DIV 2;
|
||||||
Temp := Len - ((Space * 2) + Length(Str));
|
Temp := Len - ((Space * 2) + Length(Str));
|
||||||
Result := strRep(Ch, Space) + Str + strRep(Ch, Space + Temp);
|
Result := strRep(Ch, Space) + Str + strRep(Ch, Space + Temp);
|
||||||
|
|
Loading…
Reference in New Issue