I remember exactly the same topic some time ago. Was it yours? But the exact problem I can't understand either. Plz specify it more concretely.
You can use arrays , dictionaries, lists and any other container that have unlimited length. Or VarInRange. Or, if the ranges are static, "case" (though internally it will be not more than multiple if's).
I'm not aware of a class that handles multiple ranges (like ranges.Add(3, 300); ranges.Add(40000, 50000000); if ranges.Includes(i)) but probably someone had created such one. Otherwise it seems relatively easy to create from scratch. If you need exactly this, try to search in the area of Unicode handling. This is the 1st application that comes to mind which could require multiple ranges (f.ex., to define letters of some alphabet that are not coming in single block in the Unicode table)