RightPartR function
String / Filename routines |
![]() ![]() ![]() |
acUtils
|
function RightPartR(const SubStr, Str: String): String;
|
The RightPartR function finds the LAST occurence of any sub-string (SubStr parameter) in specified string (Str parameter), and returns the part of string (SubStr) AFTER the separator (Str). If the SubStr can not be found in the Str, the function returns empty string. Unlike RightPart function, the RightPartR starts searching the sub-string from the right side of string.
|
|
![]() |
SubKey := RightPartR('\', 'Software\Microsoft\CurrentVersion');
|
// the result will be 'CurrentVersion'
|
function RightPartR(const SubStr, Str: String): String;
|
var
|
I: Integer;
|
begin
|
I := PosR(SubStr, Str);
|
if I <> 0 then
|
Result := Copy(Str, I + Length(SubStr), Length(Str))
|
else
|
Result := '';
|
end;
|
LeftPart, RightPart, LeftPartR, RightPartR, PosR and SplitStr routines.
|