split function

List<String> split (String path)

Splits path into its components using the current platform's separator.

p.split('path/to/foo'); // -> ['path', 'to', 'foo']

The path will not be normalized before splitting.

p.split('path/../foo'); // -> ['path', '..', 'foo']

If path is absolute, the root directory will be the first element in the array. Example:

// Unix
p.split('/path/to/foo'); // -> ['/', 'path', 'to', 'foo']

// Windows
p.split(r'C:\path\to\foo'); // -> [r'C:\', 'path', 'to', 'foo']

// Browser
p.split('http://dartlang.org/path/to/foo');
  // -> ['http://dartlang.org', 'path', 'to', 'foo']

Implementation

List<String> split(String path) => context.split(path);