2021-12-12 21:31:09 星期日
def get_suffix(file_name, has_dot = False):
pos = file_name.rfind(".")
if 0 < pos < len(file_name)-1:
if has_dot:
index = pos
else:
index = pos + 1
return file_name[index:]
else:
return 'None'
file_extension = get_suffix("123456.ccs", has_dot=0)
print(file_extension)
浙公网安备 33010602011771号