Slice s is a subslice of Slice t, if the underlying strings are equal
and t.startInclusive ≤ s.startInclusive and s.endExclusive ≤ t.endExclusive.
Instances For
@[simp]
theorem String.Slice.replaceStartEnd_is_subslice_of {s : Slice} {p0 p1 : s.Pos} {h : p0 ≤ p1} :
(s.slice p0 p1 h).isSubslice s
cast p : s.Pos to t.Pos
Instances For
s.startPos : s.Pos as t.Pos
Instances For
theorem String.Slice.startPosOfSubslice_eq {s t : Slice} (h : s.isSubslice t) :
{ byteIdx := s.startInclusive.offset.byteIdx - t.startInclusive.offset.byteIdx } = (startPosOfSubslice h).offset
s.endPos : s.Pos as t.Pos
Instances For
theorem String.Slice.endPosOfSubslice_eq {s t : Slice} (h : s.isSubslice t) :
{ byteIdx := s.endExclusive.offset.byteIdx - t.startInclusive.offset.byteIdx } = (endPosOfSubslice h).offset
@[simp]
@[simp]
theorem String.Slice.byteDistance_of_offset_and_char_lt {s : Slice} {pos : s.Pos} (h : pos ≠ s.endPos) :