I have got following C# code from this link: How to prevent users from typing special characters in textbox
string allowedchar = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
if (!TXT_NewPassword.Text.All(allowedchar.Contains))
{
// Not allowed char detected
}
Following code is vb.net version of above code
Dim allowedchar As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
If Not TXT_NewPassword.Text.All(allowedchar.Contains) Then
' Not allowed char detected
End If
How can I solve this error? : https://prnt.sc/mzsmkd
Error message:
Overload resolution failed because no accessible 'Contains' accepts this number of arguments