Driver code
public static void Main ( ) { string s = " abcfdeacf " ; int i = FirstRepeated ( s ) ; if ( i != - 1 ) Console . WriteLine ( " Char ▁ = ▁ " + s [ i ] + " ▁ and ▁ Index ▁ = ▁ " + i ) ; else Console . WriteLine ( " No ▁ repeated ▁ Char " ) ; } }