The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Class: none
Declaration: function ExtractSubString (const Instring: string; const occ: integer; const Separator: string): string;

The function ExtractSubString returns the substring between the occth and the (occ+1)th occurrence of the separator (without separators). The separator is specified by the parameter Separator. If occ is greater or equal to the number of separators contained in InString, an empty string is returned.

Example: Given that the variable astr contains the string 'Part1:Part Two: Part Three:Last Part' the expression ExtractSubString (astr, 1, ':'); returns 'Part Two' as substring.

Last Update: 2020-Jul-11