Program to print all substrings of a given string | Function to print all sub strings ; Pick starting point in outer loop and lengths of different strings for a given starting point ; Driver program to test above function
def subString ( s , n ) : NEW_LINE INDENT for i in range ( n ) : NEW_LINE INDENT for len in range ( i + 1 , n + 1 ) : NEW_LINE INDENT print ( s [ i : len ] ) ; NEW_LINE DEDENT DEDENT DEDENT s = " abcd " ; NEW_LINE subString ( s , len ( s ) ) ; NEW_LINE