其中Python strip() 方法用于移除字符串头尾指定的字符

split()就是将一个字符串分裂成多个字符串组成的列表

>>> image ='1.jsp,2.jsp,3.jsp,4.jsp'
>>> image_list = image.strip(',').split(',')
>>> print image_list
['1.jsp', '2.jsp', '3.jsp', '4.jsp']
>>> 

 

相关文章:

  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-10-07
  • 2022-12-23
猜你喜欢
  • 2021-09-14
  • 2022-12-23
  • 2022-01-02
  • 2021-12-14
  • 2022-12-23
  • 2021-10-07
相关资源
相似解决方案