摘要: 在读取txt文件,处理每一行字符串,使用切片 sStr[3:] 由于是txt文件,行末尾是隐藏了换行符,需要先删掉所有换行符再使用 sStr=sStr.replace("\n","") 阅读全文
posted @ 2021-03-05 14:30 vaen 阅读(98) 评论(0) 推荐(0)
摘要: # 找字符串substr在str中第time次出现的位置 def findSubStrIndex(substr, str, time): times = str.count(substr) if (times == 0) or (times < time): pass else: i = 0 ind 阅读全文
posted @ 2021-03-05 13:38 vaen 阅读(6680) 评论(0) 推荐(0)