Is there a way to search, from a string, a line containing another string and retrieve the entire line?
For example:
string = qwertyuiop asdfghj
If you prefer a one-liner:
matched_lines = [line for line in my_string.split('\n') if "substring" in line]