human
Check if a string is substring of another | Python program for the above approach.
Iterate from 0 to Len - 1.
Driver code"
Solution in Python:
 Can you provide a code to check if a string is substring of another and the other steps required?
assistant
#Here is code to check if a string is substring of another and the other steps required.
 def Substr ( Str , target ) :
	t = 0
	Len = len ( Str )
	i = 0
	for i in range ( Len ) :
		if ( t == len ( target ) ) :
			break
		if ( Str [ i ] == target [ t ] ) :
			t += 1
		else :
			t = 0
	if ( t < len ( target ) ) :
		return - 1
	else :
		return ( i - t )
print ( Substr ( " GeeksForGeeks " , " Fr " ) )
print ( Substr ( " GeeksForGeeks " , " For " ) )