System.SysUtils.TStringHelper.Split

From XE3 API Documentation
Jump to: navigation, search

Delphi

function Split(const Separator: array of Char): TArray<string>; overload;
function Split(const Separator: array of Char; Count: Integer): TArray<string>; overload;
function Split(const Separator: array of Char; Options: TStringSplitOptions): TArray<string>; overload;
function Split(const Separator: array of string; Options: TStringSplitOptions): TArray<string>; overload;
function Split(const Separator: array of Char; Count: Integer; Options: TStringSplitOptions): TArray<string>; overload;
function Split(const Separator: array of string; Count: Integer; Options: TStringSplitOptions): TArray<string>; overload;

Properties

Type Visibility Source Unit Parent
function public System.SysUtils.pas System.SysUtils TStringHelper

Description

Splits this 0-based string into substrings, using the given Separator.

var
  MyString: String;
  Splitted: TArray<String>;

begin
  MyString := String.Join(',', ['String1', 'String2', 'String3']);
  Splitted := MyString.Split([','], 2);
end.

There are six Split overloaded methods each one allowing for various splitting options.

See Also