閱讀英文

共用方式為


Char.IsBetween(Char, Char, Char) 方法

定義

指出字元是否在指定的內含範圍內。

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

參數

c
Char

要評估的字元。

minInclusive
Char

下限,包含。

maxInclusive
Char

上限,包含。

傳回

true 如果 c 位於指定的範圍內,則為 ,否則為 false

備註

方法不會驗證大於 maxInclusive 或等於 minInclusive 。 如果 maxInclusive 小於 minInclusive ,則行為為未定義。

適用於

產品 版本
.NET 7, 8, 9, 10