| LeftTillChStr Function |
Unit
QESBPCSConvert
Declaration
Function LeftTillChStr(const S: string; const Ch: Char): string;
Description
If the specified character is not found then a null string is returned. Also See: LeftStr, RightAfterChStr, RightTillChStr
| Parameters |
| S | the String from which the left substring is to be taken. |
| Ch | the character that is searched for. |
Category
Extra String Handling RoutinesImplementation
function LeftTillChStr (const S: string; const Ch: Char): string;
var
M: Integer;
begin
M := ESBPosCh (Ch, S); // Find first position of Character
if M < 2 then
Result := '' // If not found or is in the first position return ''
else
Result := LeftStr (S, M - 1); // Otherwise return the Left portion
End; |
|
|