| ESBPosCh Function |
Unit
QESBPCSConvert
Declaration
Function ESBPosCh(const Ch: Char; const S: string; Start: Integer = 1): Integer;
Description
Can optionally have a starting point.
| Parameters |
| Ch | Character to be searched for |
| S | String to Search within |
| Start | Character Position at which to start. If Start < 1 then 1 is used. If Start > Length (S) then 0 is returned. |
Returns
The Position of the Character, otherwise 0 is returned.
Category
Extra String Handling RoutinesImplementation
function ESBPosCh (const Ch: Char; const S: string; Start: Integer = 1): Integer;
var
I, N: Integer;
begin
Result := 0;
N := Length (S);
if Start < 1 then
Start := 1;
if (N = 0) or (Start > N) then
Exit;
for I := Start to N do
begin
if S [I] = Ch then
begin
Result := I;
Exit;
end;
end;
End; |
|
|