Count of sub | C # implementation of the approach ; Function to return the count of possible sub - strings of length n ; Driver code
using System ; class GFG { static int countSubStr ( string str , int n ) { int len = str . Length ; return ( len - n + 1 ) ; } public static void Main ( ) { string str = " geeksforgeeks " ; int n = 5 ; Console . WriteLine ( countSubStr ( str , n ) ) ; } }