NumberRange.Add Method
Definition
- Namespace
- GleamTech.DocumentUltimate
- Assembly
- GleamTech.DocumentUltimate.dll
Add(int)
Adds a single number to the sequence.
public virtual void Add(int singleNumber)
Parameters
singleNumberintThe single number.
Add(int?, int?)
Adds a range of numbers to the sequence. Reverse ordering is accepted.
public virtual void Add(int? startNumber, int? endNumber)
Parameters
Add(string)
Adds a range of numbers to the sequence from a string representation (e.g. 1-5, 8, 11-13).
public virtual void Add(string rangeString)
Parameters
rangeStringstringThe string containing the range of numbers.
Remarks
The range is specified as a string in the following forms or combination thereof:
| 5 | single value |
| 1,2,3,4,5 | sequence of values |
| 1-5 | closed range |
| -5 | open range (converted to a sequence from 1 to 5) |
| 1- | open range (converted to a sequence from 1 to final number) |
| all | keyword representing all numbers. |
| odd | keyword representing odd numbers. |
| even | keyword representing even numbers. |
The value delimiter can be either ',' or ';' and the range separator can be either '-' or ':'. Whitespace is permitted at any point in the input.
Any elements of the sequence that contain non-digit, non-whitespace, or non-separator characters or that are empty are ignored.