Berker Yüceer
Berker Yüceer

Reputation: 7335

How to check if a word contains only upper-case characters in a string with vb6

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

Answers (3)

Romil Kumar Jain
Romil Kumar Jain

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

Oglop
Oglop

Reputation: 260

With a regular expression perhaps? vb6 regex

Upvotes: 1

Alexander Novotny
Alexander Novotny

Reputation: 67

Try this:

If Chr("YOUR LETTER") = UCase(Chr("YOUR LETTER"))

If it's true the Letter is UPPERCASE

Upvotes: 1

Related Questions