Count of sub | Function to return the count of possible sub - strings of length n ; Driver code
function countSubStr ( str , n ) { var len = str . length ; return len - n + 1 ; } var str = " " ; var n = 5 ; document . write ( countSubStr ( str , n ) ) ;