Automating QTP Test Automation Home Automation Articles Downloads QTP Gotchas Links Books Contact About Site Map
String Function - Check all upperThis function checks if a string is ENTIRELY in upper case. Download it Here (right-click and then save target as). (NOTE - you can just cut & paste from below, but the formatting will have multiple spaces instead of tabs).
'=========================================================================
Function zStr_CheckIsAllUpper(sInput) 'This function tells you if a string is ENTIRELY in upper case 'Usage: 'If zStr_CheckIsAllUpper(sTemp) Then ' MsgBox(sTemp & " is in all upper case") 'Else ' MsgBox(sTemp & " is NOT in all upper case") 'End If Dim oRegEx, cMatches zStr_CheckIsAllUpper = True Set oRegEx = New RegExp oRegEx.Pattern = "[^A-Z]" oRegEx.IgnoreCase = False Set cMatches = oRegEx.Execute(sInput) If cMatches.Count > 0 Then zStr_CheckIsAllUpper = False End If Set cMatches = Nothing Set oRegEx = Nothing End Function '========================================================================= |