标签:ace har 字符 replace bsp code 字符串替换 字符串 col
# 字符串替换 s = " work hard" print(s.replace(‘r‘, ‘0‘)) # new replace old print(s.replace(‘wo‘, ‘01‘)) print(s.replace(‘d‘, ‘0‘)) # old not in s, return s print(s.replace(‘r‘, ‘0‘, 1)) # count=1
标签:ace har 字符 replace bsp code 字符串替换 字符串 col
原文地址:https://www.cnblogs.com/ShuComputerProgram/p/10337299.html