python 移除字符串头尾指定字符

格式
str.strip([chars]);

例子:
  path = '/media'
  print(path.lstrip('/')) # media
 
posted @ 2023-03-29 09:01  tslam  阅读(65)  评论(0)    收藏  举报