Driver program to test above function
public static void Main ( ) { string [ ] arr = { " geeksforgeeks " , " geeks " , " geek " , " geezer " } ; int n = arr . Length ; string ans = commonPrefix ( arr , n ) ; if ( ans . Length > 0 ) Console . WriteLine ( " The ▁ longest ▁ common " + " ▁ prefix ▁ is ▁ - ▁ " + ans ) ; else Console . WriteLine ( " There ▁ is ▁ no ▁ common " + " ▁ prefix " ) ; } }