blob: 84fff5e5289dfb128ccc8e85eff600f88c55fb90 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
import re
def check_substring(string, sample) :
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|