去掉字符串中的空行
原文链接:https://blog.csdn.net/qq_36292543/article/details/114928768
str = ''' 《
人民日报
》 (
2017年09月26日
04
版)
》 '''
print(str.strip().replace(' ', '').replace('\n', ''))
————————————————
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
编辑 (opens new window)
上次更新: 2021/10/11, 12:43:58