Program to accept String starting with Capital letter | C # program to accept String starting with Capital letter ; Function to check if first character is Capital ; Function to check ; Driver function
using System ; class GFG { static int checkIfStartsWithCapital ( string str ) { if ( str [ 0 ] >= ' A ' && str [ 0 ] <= ' Z ' ) return 1 ; else return 0 ; } static void check ( string str ) { if ( checkIfStartsWithCapital ( str ) == 1 ) Console . WriteLine ( " Accepted " ) ; else Console . WriteLine ( " Not ▁ Accepted " ) ; } public static void Main ( ) { string str = " GeeksforGeeks " ; check ( str ) ; str = " geeksforgeeks " ; check ( str ) ; } }