| StripLChStr Routines |
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 |
| S | 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 RoutinesImplementation
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; |
|
|