join method

String join (String part1, [ String part2, String part3, String part4, String part5, String part6, String part7, String part8 ])

Joins the given path parts into a single path. Example:

context.join('path', 'to', 'foo'); // -> 'path/to/foo'

If any part ends in a path separator, then a redundant separator will not be added:

context.join('path/', 'to', 'foo'); // -> 'path/to/foo

If a part is an absolute path, then anything before that will be ignored:

context.join('path', '/to', 'foo'); // -> '/to/foo'

Implementation

String join(String part1,
    [String part2,
    String part3,
    String part4,
    String part5,
    String part6,
    String part7,
    String part8]) {
  var parts = <String>[
    part1,
    part2,
    part3,
    part4,
    part5,
    part6,
    part7,
    part8
  ];
  _validateArgList("join", parts);
  return joinAll(parts.where((part) => part != null));
}