RightTillChStr Function
Returns the substring consisting of the right most characters from S up to but not including the specified one.

Unit
QESBPCSConvert

Declaration
Function RightTillChStr(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

Parameters
the String from which the right substring is to be taken.
Ch the character that is searched for.

Category
Extra String Handling Routines

Implementation

function RightTillChStr (const S: string; const Ch: Char): string;
var
     M: Integer;
begin
     M := ESBLastPosCh (Ch, S); // Find Last position of Character
     if (M = 0) or (M >= Length (S)) then
          Result := '' // If not found or is in the last position return ''
     else
          Result := RightAfterStr (S, M); // Otherwise return the Right portion
End;


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