%sstral() Function

Top  Previous  Next

%sstral() function ("Substring After Last") extracts the substring existing in a string after the last occurrence of the reference substring and returns it.

Syntax:

%sstral(string-expressionreference-substring-expression[, default-substring-expression])

 

string-expression

The string to extract a substring from

reference-substring-expression

The reference substring to searched. The substring to be extracted starts right after the last occurrence of this substring in string-expression

default-substring-expression

This optional parameter defines the substring to return in case of the reference substring is not found.

 

Examples:

%sstral('aaa bbb ccc',' ') %// returned value: 'ccc'

%sstral('123.45','.')      %// returned value: '45'

 

%set(full_file_name, 'c:\aaa\bbb\ccc.txt')

%set(file_name, sstral(full_file_name,'\') )   %// returned value: 'ccc.txt'

 

 

See %sstr(), %rsstr(), %sstra(), %sstral(), %sstrb(), %sstrbl()