zoukankan
html css js c++ java
python用BeautifulSoup解析源码时,去除空格及换行符
一、去除空格
strip()
" xyz "
.
strip
()
# returns "xyz"
" xyz "
.
lstrip
()
# returns "xyz "
" xyz "
.
rstrip
()
# returns " xyz"
" x y z "
.
replace
(
' '
,
''
)
# returns "xyz"
二、替换 replace("space","")
用replace(" ", ""),后边的串替换掉前边的
查看全文
相关阅读:
LCA + 二分(倍增)
Educational Codeforces Round 5
BNU 51276
POJ 1511
hdu2121
最小树形图(朱刘算法)
Educational Codeforces Round 1(D. Igor In the Museum) (BFS+离线访问)
Educational Codeforces Round 1(C. Nearest vectors)
POJ-2785 4 Values whose Sum is 0(折半枚举 sort + 二分)
POJ 1661Help Jimmy(逆向DP Or 记忆化搜索 Or 最短路径)
原文地址:https://www.cnblogs.com/valorchang/p/11468380.html
最新文章
mysql cmd常用命令
泛型算法
迭代器
元素的查找与访问
为容器定义的类型
使用关联式容器
lambda表达式
使用序列式容器
STL六大组件
引用作为返回值
热门文章
模板
Educational Codeforces Round 40 G. Castle Defense (二分+滑动数组+greedy)
使用Tarjan进行缩点(有向图)
使用Tarjan进行缩点无向图
求 无向图的割点和桥,Tarjan模板
Educational Codeforces Round 40 C. Matrix Walk( 思维)
Repeater POJ
【CodeForces】915 G. Coprime Arrays 莫比乌斯反演,前缀和,差分
洛谷 P2765 魔术球问题 (dinic求最大流,最小边覆盖)
8VC Venture Cup 2016
Copyright © 2011-2022 走看看