string= "im fine.gds how are you"
if '.gds' or '.cdl' in string :
a=string.split("????????")
the above string may contain .gds or .cdl extension. I want to split the string based on the extension.
here how the parameters can be passed to split function.(EX if .gds is present in string then it should take as split(".gds")
if .cdl is there in string then it should get split(".cdl"))
Use regular expression module
reto split either bypattern1orpattern2Example: