text validation

rangerbud249

Active member
Joined
Aug 18, 2004
Messages
27
Programming Experience
Beginner
I have this code
<code>

If e.Item.Cells(1).Text = "INFO" Then
e.Item.BackColor = System.Drawing.Color.LightBlue
End If

</code>

Instead of searching for "INFO", I would like to search for all words containing capital letters.

can anyone help me with this.

Jose
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
this is almost kind of old, but you could simply look @ each letter and check for a capital letter such as:

VB.NET:
Dim Counter As Integer
        Dim strChar As String
        Dim strString As String = txtInput.Text
        Dim strValidChars As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

        For Counter = 1 To strString.Length
            strChar = Mid(strString, Counter, 1)
            If InStr(strValidChars, strChar) <> 0 Then 
                 MessageBox.Show(strChar)
                 'Other code here for if it is a cap letter
            End if
        Next Counter
 
Top Bottom