Reputation: 7335
I'd like to find out if any word in a string contains only upper-case characters with using vb6..
Lets say ive a string like this: "If you only knew the power of the DARKSIDE!"
Here i wanna catch "DARKSIDE"
regardless of punctuation marks.
So how can i achive that? This should be easy.. Though i couldn't figure with a blink of an eye..
Upvotes: 1
Views: 2108
Reputation: 20775
Dim astrSplitItems() As String
astrSplitItems = Split(strInputString, " ")
For intX = 0 To UBound(astrSplitItems)
If astrSplitItems(intX) = UCase(astrSplitItems(intX))
//Found
End If
Next
Upvotes: 2
Reputation: 67
Try this:
If Chr("YOUR LETTER") = UCase(Chr("YOUR LETTER"))
If it's true the Letter is UPPERCASE
Upvotes: 1