I want to do a simple string match, searching from the -front- of the string. Are there easier ways to do this with maybe a builtin? (re seems like overkill)
def matchStr(ipadr = '10.20.30.40', matchIP = '10.20.'):
if ipadr[0:len(matchIP)] == matchIP: return True
return False
1 Answer