public StringSegment GetNameFromPath(StringSegment path) { var indexOfLastSeparator = path.IndexOfLast(_separators); if (indexOfLastSeparator == -1) { return(path); } return(path.SubSegment(indexOfLastSeparator + 1)); }
private static bool HasSuffixSeparator(StringSegment includePath, out int indexOfPrefixStart) { indexOfPrefixStart = includePath.IndexOfLast(SuffixSeparatorChar); if (indexOfPrefixStart == -1) { return(false); } if (includePath.Length >= indexOfPrefixStart + BlittableJsonTraverser.CollectionAndPropertySeparators.Length) { if (includePath[indexOfPrefixStart] == BlittableJsonTraverser.CollectionAndPropertySeparators[0] && includePath[indexOfPrefixStart + 1] == BlittableJsonTraverser.CollectionAndPropertySeparators[1] && includePath[indexOfPrefixStart + 2] == BlittableJsonTraverser.CollectionAndPropertySeparators[2]) { // []. means collection return(false); } } return(true); }