Driver Code
static void Main ( ) { List < string > list = new List < string > ( ) ; list . Add ( " abab " ) ; list . Add ( " gfg " ) ; foreach ( string s in list ) { int cnt = countSub ( s ) ; int withEmptyString = cnt + 1 ; Console . WriteLine ( " With ▁ empty ▁ string ▁ count ▁ for ▁ " + s + " ▁ is ▁ " + withEmptyString ) ; Console . WriteLine ( " Without ▁ empty ▁ string ▁ count ▁ for ▁ " + s + " ▁ is ▁ " + cnt ) ; } } }