我想\n
从开头删除这样的行\n id int(10) NOT NULL
。我试过了strip()
,,,rstrip()
。lstrip()
replace('\n', '')
我不明白。我究竟做错了什么?
print(column)
print(column.__class__)
x = column.rstrip('\n')
print(x)
x = column.lstrip('\n')
print(x)
x = column.strip('\n')
print(x)
print(repr(column))
给
\n id int(10) NOT NULL
<type 'str'>
\n id int(10) NOT NULL
\n id int(10) NOT NULL
\n id int(10) NOT NULL
\n id int(10) NOT NULL
'\\n `id` int(10) NOT NULL'