Pascal Scripting: StringSplitEx

Prototype

function StringSplitEx(const S: String; const Separators: TArrayOfString; const Quote: Char; const Typ: TSplitType): TArrayOfString;

Description

Splits the given string into substrings, using the given characters or strings to be used as separator. Empty substrings can be ignored. Use the Quote parameter to specify the start and end character of a quoted part of the string where separators are ignored.

TSplitType is defined as:

TSplitType = (stAll, stExcludeEmpty, stExcludeLastEmpty);

Example:
var
  A: array of String;
begin
  A := StringSplitEx('1,",",2', [','], '"', stAll);
  // A = ['1','","','2']
end;

See also

StringSplit