C#中的Char.IsLower()方法

C#中的Char.IsLower()方法用于指示是否将指定的Unicode字符归类为小写字母。

语法

以下是语法-

public static bool IsLower (char ch);

上面的参数ch是要评估的Unicode字符。

示例

现在让我们看一个实现Char.IsLower()方法的示例-

using System;
public class Demo {
   public static void Main(){
      bool res;
      char val = 'K';
      Console.WriteLine("Value = "+val);
      res = Char.IsLower(val);
      Console.WriteLine("Is the value a lowercase letter? = "+res);
   }
}

输出结果

这将产生以下输出-

Value = K
Is the value a lowercase letter? = False

示例

现在让我们来看另一个示例-

using System;
public class Demo {
   public static void Main(){
      bool res;
      char val = 'd';
      Console.WriteLine("Value = "+val);
      res = Char.IsLower(val);
      Console.WriteLine("Is the value a lowercase letter? = "+res);
   }
}

输出结果

这将产生以下输出-

Value = d
Is the value a lowercase letter? = True