s = " abc "
# 去左空格
s1 = s.lstrip()
print(s1)
# 去右空格
s2 = s.rstrip()
print(s2)
# 去左右空格
s3 = s.strip()
print(s3)
print("strip方法用的最多")
python 字符串 去除左右空格 strip方法
阅读 125
2023-03-08
s = " abc "
# 去左空格
s1 = s.lstrip()
print(s1)
# 去右空格
s2 = s.rstrip()
print(s2)
# 去左右空格
s3 = s.strip()
print(s3)
print("strip方法用的最多")
相关推荐
精彩评论(0)