How to check if a string contains only blank spaces and / or zeros in VB.NET

1 Answer

0 votes
Imports System
Imports System.Linq

Public Class Program
	Public Shared Sub Main()
        Dim str As String = "00 00000 00 0 0 000 00 0"
		
        Dim result As Boolean = str.Any(Function(ch) ch = " "c OrElse ch = "0"c)
			
        Console.Write(result)
    End Sub
End Class
	
	
	

' run:
'
' True
'

 



answered Apr 12, 2023 by avibootz
...