The IntRanges Class contains the following constructors:
IntRanges()
IntRanges(String str)
IntRanges(String str, String delims)
Constructs an empty set of ranges as an IntArrayOutputStream object.
public IntRanges();
Constructs a set of ranges from the given string.
public IntRanges(String str);
Throws IllegalArgumentException if the string to be parsed is invalid.
str | A string containing ranges of integers, where the bounds of each range are separated by a hyphen (-), and separate ranges are delimited by commas. A range of a single integer can be entered by including just the single integer, separated by delimiters. For example: 1-5,9-11,44,13-120. |
Constructs a set of ranges from the given string with specified delimiters.
public IntRanges(String str, String delims);
Throws IllegalArgumentException if the string to be parsed is invalid.
str | A string containing ranges of integers, where the bounds of each range are separated by a hyphen (-). A range of a single integer can be entered by including just the single integer, separated by delimiters. |
delims | The character or characters that separate the ranges. |