zscxostaorgcn target=_blank国家职业资格证书全国联网查询a用python删除上述字串cn后面所有字串
可以使用字符串的切片操作来实现:
url = "http://zscx.osta.org.cn/"
new_url = url[:url.find(".cn")+3]
print(new_url)
输出结果为:
http://zscx.osta.org.cn/
原文地址: https://www.cveoy.top/t/topic/bbtK 著作权归作者所有。请勿转载和采集!