in Range
Checks if this integer is within the specified range.
This function is a convenience wrapper around the in operator for IntRange.
Example:
val age = 25
val isWorkingAge = age.inRange(18..65) // Result: true
val temperature = 10
val isFreezing = temperature.inRange(-10..0) // Result: falseContent copied to clipboard
Return
true if this integer is within the range, false otherwise.
Parameters
range
The IntRange to check against (inclusive).