Home
Sign Up
Sign In
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
关于对字符串进行 strip,一个奇怪的原因
RicardoScofileld
·
Jul 3, 2018
· 2865 views
This topic created in 3048 days ago, the information mentioned may be changed or developed.
就是对一条字符串进行 strip 操作,没有效果,但是用 replace 就可以生效,不知道大家有没有遇到这种情况。刚我又试了一下,貌似是 json 字符串进行 strip 就没有效果
strip
字符
Replace
生效
6 replies
ofooo
Jul 3, 2018
1
卧槽我也是。。。。为什么啊
RicardoScofileld
OP
Jul 3, 2018
2
@
ofooo
我特么研究半天,split,startswith 等操作都有效果,就是 strip 没有效果,按理来说 json_str 也算 str 类型的啊,我自省也是 str 类型的,但特么为什么就是没有效果啊
samirmw
Jul 3, 2018 via Android
3
贴字符串上来看看啊
dengshuang
Jul 3, 2018
4
str(json)
RicardoScofileld
OP
Jul 4, 2018
5
@
ofooo
strip 只能去除最边上的字符,是我理解错了
laike9m
Jul 4, 2018 via Android
6
给个例子?以及期望输出结果
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
2045 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 28ms ·
UTC 02:30
·
PVG 10:30
·
LAX 18:30
·
JFK 21:30
♥ Do have faith in what you're doing.
❯