In[2]: a=‘ ddd dfe dfd efre ddd ‘ In[3]: a Out[3]: ‘ ddd dfe dfd efre ddd ‘ In[4]: a.strip() Out[4]: ‘ddd dfe dfd efre ddd‘ In[5]: a.lstrip() Out[5]: ‘ddd dfe dfd efre ddd ‘ In[6]: a.rstrip() Out[6]: ‘ ddd dfe dfd efre ddd‘ In[7]: a.replace(‘ ‘,‘‘) Out[7]: ‘ddddfedfdefreddd‘ In[8]: a.split() Out[8]: [‘ddd‘, ‘dfe‘, ‘dfd‘, ‘efre‘, ‘ddd‘]
时间: 2024-10-12 17:44:31