Driver code
public static void main ( String args [ ] ) { String str = " abbcaceghcak " ; int n = str . length ( ) ; char x = ' a ' , y = ' c ' ; System . out . print ( " Count ▁ = ▁ " + countSubstr ( str , n , x , y ) ) ; } }