How to check if string contain uppercase characters with Linq in C#

1 Answer

0 votes
using System;
using System.Linq;

class Program
{
    static void Main() {
        String s = "c# vb.net Python JAVA";
        
        if (s.Any(char.IsUpper)) {
            Console.WriteLine("yes");
        } else {
            Console.WriteLine("no");
        }
    }
}



/*
run:

yes

*/

 



answered Nov 24, 2020 by avibootz
...