CharInterval Struct
Stores an interval of characters.
public struct CharInterval
Constructors
CharInterval(Char)
Initializes a new instance of the CharInterval class.
public CharInterval(char ch)
Parameter | Type | Description |
---|---|---|
ch | Char | The character in the interval. |
CharInterval(Char, Char)
Initializes a new instance of the CharInterval class.
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
Gets the number of characters contained in interval.
End
Gets or sets the end character in the interval of this CharInterval.
public char End { get; set; }
Property Value
- Char:
The end character in the interval of this CharInterval.
Start
Gets or sets the start character in the interval of this CharInterval.
public char Start { get; set; }
Property Value
- Char:
The start character in the interval of this CharInterval.
Methods
Contains(CharInterval)
Returns whether the specified character interval is contained by the interval.
public bool Contains(CharInterval interval)
Parameter | Type | Description |
---|---|---|
interval | CharInterval | The character interval to test. |
Returns
- Boolean:
true
if the specified character interval is contained by the interval; otherwise,false
.
Contains(Char)
Returns whether the specified character is contained by the interval.
public bool Contains(char ch)
Parameter | Type | Description |
---|---|---|
ch | Char | The character to test. |
Returns
- Boolean:
true
if the specified character is contained by the interval; otherwise,false
.
Equals(Object)
Determines whether the specified Object
is equal to the current Object
.
public override bool Equals(object obj)
Parameter | Type | Description |
---|---|---|
obj | Object | The |
Returns
- Boolean:
true
if the specifiedObject
is equal to the currentObject
; otherwise,false
.
GetHashCode()
Returns a hash code for this object.
public override int GetHashCode()
Returns
- Int32:
An integer value that specifies a hash value for this object.
GetIntersection(CharInterval)
Creates the intersection of the interval with another CharInterval.
public CharInterval GetIntersection(CharInterval interval)
Parameter | Type | Description |
---|---|---|
interval | CharInterval | The CharInterval used to find the intersection. |
Returns
- CharInterval:
The intersection of the interval with another CharInterval.
IntersectsWith(CharInterval)
Returns whether the specified character interval intersects with the interval.
public bool IntersectsWith(CharInterval interval)
Parameter | Type | Description |
---|---|---|
interval | CharInterval | The character interval to test. |
Returns
- Boolean:
true
if the specified character interval intersects with the interval; otherwise,false
.
ToString()
Converts the object to a String
.
Operators
Equality(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
- Boolean:
true
if the color values ofleft
andright
are equal; otherwise,false
.
Inequality(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
- Boolean:
true
if the color values ofleft
andright
are unequal; otherwise,false
.