Char.IsBetween(Char, Char, Char) Method

Definition

Indicates whether a character is within the specified inclusive range.

public static bool IsBetween (char c, char minInclusive, char maxInclusive);

Parameters

c
Char

The character to evaluate.

minInclusive
Char

The lower bound, inclusive.

maxInclusive
Char

The upper bound, inclusive.

Returns

true if c is within the specified range; otherwise, false.

Remarks

The method does not validate that maxInclusive is greater than or equal to minInclusive. If maxInclusive is less than minInclusive, the behavior is undefined.

Applies to

Product Versions
.NET 7, 8, 9