Products
GG网络技术分享 2025-03-18 16:15 0
小说里的章节用 数字、 来划分,
如何用sublime text将这些 数字、 替换成 第 数字 章
远程看看吧
import re
strs=""
with open("2.txt","r",encoding="utf-8") as fp:
txt=fp.readline()while txt:
tlist=re.findall("\\d+、",txt)
if tlist:
temp=tlist[0].replace("、","")
# print(temp)
txt=txt.replace(temp+"、","第"+temp+"章 ")
print(txt)
strs=strs+txt
txt = fp.readline()
with open("1.txt","a",encoding="utf-8") as f:
f.write(strs)
不用看懂,收藏就完了,以后你肯定会用到的。
今天带来的是前端开发中经常碰到的数字问题,解决方式有些过于粗暴,未来还会不断美化更新。
前端页面和数据处理虽然看起来简单,但是一个优秀的前端工程师对于细节的把控也是至关重要的,如何合理处理业务也体现前端工程师对性能优化的功力
Demand feedback