How can I read a specific line from a string in Python? For example, let's say I want line 2 of the following string:
string = """The quick brown fox
jumps over the
lazy dog."""
line = getLineFromString(string, 2)
print(line) # jumps over the
There are several questions about reading specific lines from a file, but how would I read specific lines from a string?