python re sub remove newline code example
Example 1: python strip newline from string
a_string = a_string.rstrip("\n")
Example 2: python remove new line
lines = ("line 1 \r\n")
lines.rstrip("\n\r")
a_string = a_string.rstrip("\n")
lines = ("line 1 \r\n")
lines.rstrip("\n\r")