Check If String Is Substring Of Another String

[Solved] Check If String Is Substring Of Another String | Swift - Code Explorer | yomemimo.com
Question : Find If String Is Substring Of Another

Answered by : eric-tam

#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 : | Last Update : Wed, 20 Jul 22

Answers related to check if string is substring of another string

Code Explorer Popular Question For Swift