Source Code:
(back to article)
string = "Hello, World!" substring = "World" # Using the str.__contains__() method if string.__contains__(substring): print("The substring '{}' is present in the string '{}'.".format(substring, string)) else: print("The substring '{}' is not present in the string '{}'.".format(substring, string))
Result:
Report an issue