Run
# Take a string x = "This is line 1.\nThis is line 2.\nThis is line 3." # Given N new_line_index = x.find('\n') # Variable to hold resulting string x_without_first_line = '' if new_line_index > -1: # Remove first line x_without_first_line = x[new_line_index+1:] print(f"Given string\n\"{x}\"\n") print(f"Result string\n\"{x_without_first_line}\"")
Output