Lower case to upper case | C # program to convert a string to uppercase ; Converts a string to uppercase ; Driver code
using System ; class GFG { static String to_upper ( char [ ] str ) { for ( int i = 0 ; i < str . Length ; i ++ ) if ( ' a ' <= str [ i ] && str [ i ] <= ' z ' ) str [ i ] = ( char ) ( ( int ) str [ i ] & ( ~ ( 1 << 5 ) ) ) ; return String . Join ( " " , str ) ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; Console . WriteLine ( to_upper ( str . ToCharArray ( ) ) ) ; } }