Python怎么去掉最后的空格


当前第2页 返回上一页

当rm为空时,默认删除空白符(包括’\n’, ‘\r’, ‘\t’, ’ ')

1

2

3

4

5

6

7

8

>>> a = ' hello world!!'

>>> a.strip()

'hello world!!'

>>> a='\t\thello world!!'

'hello world!!'

>>> a = 'hello world!!\r\n'

>>> a.strip()

'hello world!!'

更多Python相关技术文章,请访问Python教程栏目进行学习!

以上就是Python怎么去掉最后的空格的详细内容,更多文章请关注木庄网络博客!!

返回前面的内容

相关阅读 >>

介绍Python的抖音快手字符舞

Python里d是什么意思

Python 中的int()函数怎么用

Python是强类型语言吗

Python怎么print出共轭复数

Python是如何爬取散文网的文章的?

Python中线程的mq消息队列实现及优缺点介绍

Python字典改变键值对的方法

Python里面def是什么意思

Python生成任意范围任意精度的随机数的方法

更多相关阅读请进入《Python》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...