Span Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An immutable integer interval that describes a range of values from Start to End that is closed on the left and open on the right: [Start .. End). A span is usually applied to an ITextSnapshot to denote a span of text, but it is independent of any particular text buffer or snapshot.
public value class Span
public value class Span
struct Span
public struct Span
type Span = struct
Public Structure 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 |
The end of the span. The span is open-ended on the right side, which is to say that Start + Length = End. |
IsEmpty |
Determines whether or not this span is empty. |
Length |
The length of the span, which is always non-negative. |
Start |
The starting index of the span. |
Methods
Contains(Int32) |
Determines whether the position lies within the span. |
Contains(Span) |
Determines whether |
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) |
Returns the intersection with the given span, or null if there is no intersection. |
IntersectsWith(Span) |
Determines whether |
Overlap(Span) |
Returns the overlap with the given span, or null if there is no overlap. |
OverlapsWith(Span) |
Determines whether |
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. |