蟒蛇拆分字符串在换行并保留换行
问题描述:
答
使用splitlines()
,传递true:
"amount\nexceeds".splitlines(True)
为您提供:
["amount\n", "exceeds"]