Span Struct

Definition

Represents a range.

public struct Span
Inheritance
Span

Remarks

This structure represents an immutable integer interval that describes a range of values, from Start to End. It is closed on the left and open on the right: [Start .. End). In the context of an ITextSnapshot it represents a span of text, but the span structure itself is independent of any particular text buffer or snapshot.

Constructors

Span(Int32, Int32)

Initializes a new instance of a Span with the given start point and length.

Properties

End

Gets the end of the span.

IsEmpty

Determines whether or not this span is empty.

Length

Gets the length of the span, which is always non-negative.

Start

Gets the starting index of the span.

Methods

Contains(Span)

Determines whether the specified span falls completely within this span.

Contains(Int32)

Determines whether the position lies within the span.

Equals(Object)

Determines whether two spans are the same.

FromBounds(Int32, Int32)

Initializes a new instance of a Span with the given start and end positions.

GetHashCode()

Provides a hash function for the type.

Intersection(Span)

Gets the intersection with the given span, or null if there is no intersection.

IntersectsWith(Span)

Determines whether span intersects this span.

Overlap(Span)

Gets the overlap with the specified span.

OverlapsWith(Span)

Determines whether the specified span overlaps this span.

ToString()

Provides a string representation of the span.

Operators

Equality(Span, Span)

Determines whether two spans are the same.

Inequality(Span, Span)

Determines whether two spans are different.

Applies to