Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Find If String Is Substring Of Another

#is target in base?

def findSubstring(base, target):
   match = ""
   for x in range(0, len(base)):
       substring = base[0:len(base)-x]
       if substring == target:
           print("there is a match")
           match = substring
            
   if match == "":
     return ""
   else:
     return match
      


print(findSubstring("aaaaaaa", "aaa"))
Source by replit.com #
 
PREVIOUS NEXT
Tagged: #Find #If #String #Is #Substring #Of #Another
ADD COMMENT
Topic
Name
4+1 =