Python - Deleting the first 2 lines of a string

前端 未结 6 1797
渐次进展
渐次进展 2021-02-07 00:39

I\'ve searched many threads here on removing the first two lines of a string but I can\'t seem to get it to work with every solution I\'ve tried.

Here is what my string

6条回答
  •  天涯浪人
    2021-02-07 01:21

    Remove the lines with split:

    lines = """version 1.00
    6992
    [-4.32063, -9.1198, -106.59][0.00064, 0.99993, -0.01210][etc...]"""
    
    lines = lines.split('\n',2)[-1]
    

提交回复
热议问题