How can you get the nth line of a string in Python 3? For example
getline(\"line1\\nline2\\nline3\",3)
Is there any way to do this
Try the following:
s = "line1\nline2\nline3" print s.splitlines()[2]