Driver code
public static void Main ( String [ ] args ) { char [ ] str = " g ▁ eeks ▁ for ▁ ge ▁ eeks ▁ " . ToCharArray ( ) ; int i = removeSpaces ( str ) ; Console . WriteLine ( String . Join ( " " , str ) . Substring ( 0 , i ) ) ; } }