PadChLeftStr Function
Returns a string with the specified character added to the beginning of the string until the string is of the given length.

Unit
QESBPCSConvert

Declaration
Function PadChLeftStr(const S: string; const Ch: Char; const Len: LongWord): string;

Description
Also See: PadLeftStr, PadChRightStr

Parameters
the String to pad.
Ch the character to use for padding
Len the length of the resultant substring. If Length (S) >= Len then NO padding occurs, and S is returned.

Category
Extra String Handling Routines

Implementation

function PadChLeftStr (const S: string; const Ch: Char;
     const Len: LongWord): string;
var
     N: LongWord;
begin
     N := Length (S);
     if N < Len then
          Result := FillStr (Ch, Len - N) + S
     else
          Result := S;
End;


HTML generated by Time2HELP
http://www.time2help.com