xpfFindLastCharInString

FUNCTION xpfFindLastCharInString (str                 : STRING;
                                  char                : STRING(1) FIXED)                          
                                  indexOfMatchingChar : INTEGER;
                

The function xpfFindLastCharInString searches the string str for the last occurrence of the character char. If char is found in str then the index of the character char in str is returned as the function value. If char is not found in str zero is the returned function value.

Arguments


TypeNameComment
STRINGstrInput string
STRING(1) FIXEDcharThe character to be searched for

Return Value


 

TypeNameComment
INTEGERindexOfMatchingCharIndex of the last occurrence of the given character

Options


 

Example


-- cut file name from concatenated path/name string
i := xpfFindLastCharInString(pathname,'\');
IF i>0 THEN
	file_name := pathname[i+1:LENGTH(pathname)];
ELSE
	file_name := pathname;   	
END_IF;

 

See also

Filter by label

There are no items with the selected labels at this time.