Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool IsLowerCase( this string text ) {
- if ( string.IsNullOrEmpty( text ) ) { return true; }
- foreach ( char c in text )
- if ( char.IsLetter( c ) && !char.IsLower( c ) )
- return false;
- return true;
- }
- "someString".IsLowerCase();
- char.IsLower(c);
- string upper = "CONVERTED FROM UPPERCASE";
- Console.WriteLine(upper.ToLower());
- CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
- TextInfo textInfo = cultureInfo.TextInfo;
- Console.WriteLine(textInfo.ToTitleCase(title));
- Console.WriteLine(textInfo.ToLower(title));
- Console.WriteLine(textInfo.ToUpper(title));
- string s = ...
- s.All(c => char.IsLower(c));
- s.ToLower(CultureInfo.CurrentUICulture) == s;
- Imports System.Runtime.CompilerServices
- Module CustomExtensions
- <Extension()> _
- Public Function IsLowerCase(ByVal Input As String) As Boolean
- Return Return Input.All(Function(c) Char.IsLower(c))
- End Function
- End Module
- using System.Runtime.CompilerServices;
- static class CustomExtensions
- {
- public static bool IsLowerCase(this string Input)
- {
- return Input.All(c => char.IsLower(c));
- }
- }
- Console.WriteLine("ThisIsMyTestString".IsLowerCase())
- public bool IsLower(string TestString)
- {
- if (String.IsNullOrEmpty(TestString))
- {
- return true;
- }
- string testlower = TestString.ToLowerInvariant();
- if (String.Compare(TestString, testlower, false) == 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- return Input.ToList().Exists(c => Char.IsUpper(c));
- char.IsLetter( c )
Add Comment
Please, Sign In to add comment