NSpan is a structure that contains a text span (its starting and ending positions). The ending position indicates a character that follows the span. If the the starting position is equal to ending position, then the span is empty.

namespace Nitra
{
  [Record, StructuralEquality]
  public struct NSpan
  {
    public StartPos : int { get; }
    public EndPos   : int { get; }
    public Length   : int { get; }
    public IsEmpty  : bool { get; }

    public IntersectsWith(start : int, end : int) : bool;
    public IntersectsWith(other : NSpan)         : bool;
    public IntersectsWith(other : Location)       : bool;
    public Intersection(start : int, end : int)   : ValueOption[NSpan];
    public override ToString() : string;
  }
}

See also

Nitra.Runtime.dll