find uppercase chars in string

nandoliveira

Member
Joined
Jun 17, 2008
Messages
7
Programming Experience
Beginner
hi, i'm new in Vb.Net programming and i need to do a litle function that recives one string and return 1 if there are letters uppercase [with exception of the first one] and zero in oposite case:

Exemple:

"This string is good" ==>> return 0
"This String have Capitall letters in the midle " ==>> return 1

Thanks for the attencion

:)
 
Try this function, it ignores first char:
VB.NET:
Function ContainsCapitals(ByVal s As String) As Boolean
    s = s.Substring(1)
    Return s <> s.ToLower
End Function
 
Back
Top