Check
Check static class with its methods provides functionality for determining if some variable's value meets specified conditions.
IsInRange
Determines whether specified string value length lays in provided boundaries with inclusion:
Check.IsInRange("123", 4, 8); // --> false
Check.IsInRange("123456", 4, 8); // --> trueSame method for DateTime determines whether specified value lays in provided boundaries with inclusion:
Check.IsInRange("1980-01-01", DateTime.Parse("1990-01-01"), DateTime.Parse("2022-12-31")) // --> false
Check.IsInRange("2000-05-30", DateTime.Parse("1990-01-01"), DateTime.Parse("2022-12-31")) // --> trueThere are similar methods for checking IsGreaterThan and IsLessThan conditions.
Last updated
Was this helpful?