Snippet Fire

Beta
 Log In    |   Sign Up

.NET : Check If All Characters In a String Are Upper Case

Added on Jan-19-2012 by mikeSarg
For .NET

Tags : c#regexstring

Returns true of the string only contains upper case characters.

DOWNLOAD

using System.Text.RegularExpressions;
...
static bool AllCapitals(string inputString)
{
   return Regex.IsMatch(inputString, @"^[A-Z]+$");
}

    

Report Snippet

blog comments powered by Disqus