StripLChStr Routines
Returns the String with all specified leading characters removed.

Unit
QESBPCSConvert

Overloaded Variants
Function StripLChStr(const S: string; const Ch: Char): string;
Function StripLChStr(const S: string; const Chars: TESBCharSet): string;

Declaration
Function StripLChStr(const S: string; const Ch: Char): string;

Description
Also See: StripTChStr, StripChStr, StripChFromStr

Parameters
the String from which the characters are to be removed.
Ch the character that is to be stripped off.
Chars alternatively can pass a set of Characters to remove.

Category
Extra String Handling Routines

Implementation

function StripLChStr (const S: string; const Ch: Char): string;
var
     I, Len: LongWord;
begin
     Len := Length (S);
     I := 1;
     while (I <= Len) and (S [I] = Ch) do
          Inc (I);
     if (I > Len) then
          Result := ''
     else
          Result := Copy (S, I, Len - I + 1);
End;

Declaration
Function StripLChStr(const S: string; const Chars: TESBCharSet): string;

Implementation

function StripLChStr (const S: string; const Chars: TESBCharSet): string;
var
     Len, I: Integer;
begin
     if Chars = [] then
          Result := S
     else
     begin
          Len := Length (S);
          I := 1;
          while (I <= Len) and (S [I] in Chars) do
               Inc (I);
          if (I > Len) then
               Result := ''
          else
               Result := Copy (S, I, Len - I + 1);
     end;
End;


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