Constructor
new Range(locationopt, lengthopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
location |
number |
<optional> |
-1 | Starting index of the range. |
length |
number |
<optional> |
0 | Number of characters in the range. |
Classes
Members
length :number
Number of characters in the range.
Type:
- number
location :number
Starting index of the range.
Type:
- number
Methods
isValid() → {boolean}
Returns whether the range contains a location >= 0.
Returns:
- Type
- boolean
max(valueopt) → {number}
Sets the end index of the range, which indicates the character immediately after the last one in the range.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
number |
<optional> |
End of the range. |
Returns:
- Type
- number
toArray() → {RangeTuple}
Returns an array of the range's start and end indexes.
Returns:
- Type
- RangeTuple
toString() → {string}
Returns a string representation of the range's open interval.
Returns:
- Type
- string