How to check if a string contains only blank spaces and / or zeros in C#

1 Answer

0 votes
using System;
using System.Linq;

class Program
{
    static void Main() {
        string str = "00 00000 00 0 0 000 00 0";

        bool result = str.Any(ch => ch == ' ' || ch == '0');

        Console.Write(result);
    }
}




/*
run:

True

*/

 



answered Apr 12, 2023 by avibootz
...