public PathSegments RelativeTo(PathSegments other, bool caseSensitive) { var i = 0; while (i < _segments.Count && i < other._segments.Count && Equal(_segments[i], other._segments[i], caseSensitive)) { i++; } if (i == 0) { return(null); } return(From(i)); }
public PathSegments Combine(PathSegments other) { if (IsEmpty) { return(other); } if (other.IsEmpty) { return(this); } if (!other.IsRelative) { return(other); } var list = new List <string>(_segments.Count + other._segments.Count); list.AddRange(_segments); list.AddRange(other._segments); return(Create(list)); }