|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
其中我的字符串前边有换行和制表符,直接使用strip()方法就把他们都删除了,不是默认只删除空格么?
- >>> abc
- '\r\n\t\t\t\r\n Scripts, examples and news about Python programming for the Windows platform.\r\n'
- >>> abc.strip()
- 'Scripts, examples and news about Python programming for the Windows platform.'
- >>> help(abc.strip)
- Help on built-in function strip:
- strip(chars=None, /) method of builtins.str instance
- Return a copy of the string with leading and trailing whitespace remove.
-
- If chars is given and not None, remove characters in chars instead.
复制代码 |
|