If current character is equal to the starting character of str
if string [ i ] == string [ 0 ] : NEW_LINE INDENT count += subStringsStartingHere ( string , n , i ) NEW_LINE DEDENT return count NEW_LINE