Print the middle character of a string | C # program for the above approach ; Function that prints the middle character of a string ; Finding string length ; Finding middle index of string ; Print the middle character of the string ; Driver Code ; Given string str ; Function call
using System ; class GFG { public static void printMiddlechar ( String str ) { int len = str . Length ; int middle = len / 2 ; Console . WriteLine ( str [ middle ] ) ; } public static void Main ( String [ ] args ) { String str = " GeeksForGeeks " ; printMiddlechar ( str ) ; } }