Python - Deleting the first 2 lines of a string Python - Deleting the first 2 lines of a string python python

Python - Deleting the first 2 lines of a string


I don't know what your end character is, but what about something like

postString = inputString.split("\n",2)[2]

The end character might need to be escaped, but that is what I would start with.


x="""version 1.006992[-4.32063, -9.1198, -106.59][0.00064, 0.99993, -0.01210][etc...]abcasdda"""print "\n".join(x.split("\n")[2:])

You can simply do this.


Remove the lines with split:

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