Whether the first character of a string is upper cased. Info: if char = '0' or char = '.', IsUpper(char) = false. - CSharp System

CSharp examples for System:String Case

Description

Whether the first character of a string is upper cased. Info: if char = '0' or char = '.', IsUpper(char) = false.

Demo Code


using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.Text;
using System.Net.Mail;
using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using System;/*w w w  .j  a  v a2s.c om*/

public class Main{
        /// <summary>
        /// Whether the first character of a string is upper cased. 
        /// Info: if char = '0' or char = '.', IsUpper(char) = false.
        /// </summary>
        public static bool IsFirstCharUpperCased(string input)
        {
            if (string.IsNullOrEmpty(input))
            {
                return false;
            }

            return char.IsUpper(input.First());
        }
}

Related Tutorials