将多行文本,以行为单位进行分割
工具/原料
1
Windows 10
2
python 3.7
方法/步骤
1
打开cmd
2
进佛罪蚂入python交互界面著处
3
定义多况祝行字符串str = 'ab c \n de f \n gh i\n'
4
用splitlines()进行分割 lines = str.splitlines()
5
打印输出
总结
1.打开cmd2.进入python交互界面3.定义多行字符串str = 'ab c \n de f \n gh i\n'4.用splitlines()进行分割 lines = str.splitlines()5.打印输出
上一篇:MATLAB如何分割字符串?
下一篇:EXCEL如何拆分有规律的字符串