我已经开始学习Python,我想知道是否有一种方法可以与trim()Python相反。例如,我有字符串:"Need some help around here"并且我希望它成为" Need some help around here "?
trim()
"Need some help around here"
" Need some help around here "
不,strip()删除头部和尾部的所有空间。但是你可以
strip()
' %s ' % 'Need some help around here'
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
点击生成二维码
我来说两句