CharInterval Struct
Stores an interval of characters.
public struct CharInterval : IEquatable<CharInterval>
- Implements:
- IEquatable<CharInterval>
Constructors
CharInterval(char)
Initializes an instance of the structure.
public CharInterval(char ch)
| Parameter | Type | Description |
|---|---|---|
| ch | char | The single character in the interval. |
CharInterval(char, char)
Stores an interval of characters.
public CharInterval(char start, char end)
| Parameter | Type | Description |
|---|---|---|
| start | char | The start character in the interval. |
| end | char | The end character in the interval. |
Properties
Count
The number of characters contained in interval.
End
The end character in the interval of this interval.
Start
The start character in the interval of this interval.
Methods
Contains(CharInterval)
Returns whether the specified CharInterval is inclusively contained by this interval.
public readonly bool Contains(CharInterval interval)
| Parameter | Type | Description |
|---|---|---|
| interval | CharInterval | The CharInterval to test. |
Returns
- bool:
trueif the specified CharInterval is inclusively contained by this interval; otherwise,false.
Contains(char)
Returns whether the specified character is contained by the interval.
public readonly bool Contains(char ch)
| Parameter | Type | Description |
|---|---|---|
| ch | char | The character to test. |
Returns
- bool:
trueif the specified character is contained by the interval; otherwise,false.
Equals(CharInterval)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(CharInterval other)
| Parameter | Type | Description |
|---|---|---|
| other | CharInterval | An object to compare with this object. |
Returns
- bool:
trueif the current object is equal to theotherparameter; otherwise,false.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override readonly bool Equals(object? obj)
| Parameter | Type | Description |
|---|---|---|
| obj | object | The object to compare with the current object. |
Returns
- bool:
trueif the specified object is equal to the current object; otherwise,false.
GetHashCode()
Serves as the default hash function.
GetIntersection(CharInterval)
Creates the intersection of the interval with another CharInterval.
public readonly CharInterval GetIntersection(CharInterval interval)
| Parameter | Type | Description |
|---|---|---|
| interval | CharInterval | The CharInterval used to find the intersection. |
Returns
IntersectsWith(CharInterval)
Returns whether the specified CharInterval intersects with this interval.
public readonly bool IntersectsWith(CharInterval interval)
| Parameter | Type | Description |
|---|---|---|
| interval | CharInterval | The CharInterval to test. |
Returns
- bool:
trueif the specified CharInterval intersects with this interval; otherwise,false.
ToString()
Returns the string representation of this object.
public override readonly string ToString()
Returns
- string:
The string representation of this object.
Operators
operator ==(CharInterval, CharInterval)
Compares two color objects for equality.
public static bool operator ==(CharInterval left, CharInterval right)
| Parameter | Type | Description |
|---|---|---|
| left | CharInterval | A CharInterval to compare. |
| right | CharInterval | A CharInterval to compare. |
Returns
- bool:
trueif the color values ofleftandrightare equal; otherwise,false.
operator !=(CharInterval, CharInterval)
Compares two color objects for inequality.
public static bool operator !=(CharInterval left, CharInterval right)
| Parameter | Type | Description |
|---|---|---|
| left | CharInterval | A CharInterval to compare. |
| right | CharInterval | A CharInterval to compare. |
Returns
- bool:
trueif the color values ofleftandrightare unequal; otherwise,false.