Check if string contain Uppercase.

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

Is there a way if a string contain upper cas letter?
Is there a way if a string contain Numbers?
Is there a way if a string contain (Puntuation/Symbols) such as ~,!,#,$....?

Thanks
 
Is there a way if a string contain upper cas letter?
Is there a way if a string contain Numbers?
Is there a way if a string contain (Puntuation/Symbols) such as ~,!,#,$....?

Thanks

Regex can do all of this. I typed these patterns on-the-fly so they
may not be perfect:

Dim theString As String = "$10 = Ten Dollars"

If Regex.IsMatch(theString, "[A-Z]") Then MsgBox("Has Capital
Letter(s)")

If Regex.IsMatch(theString, "\d") Then MsgBox("Has Numbers")

If Regex.IsMatch(theString, "[^\w\d\s]") Then MsgBox("Has
Symbols")

Thanks,

Seth Rowe
 
Back
Top