get rid of n in string python code example Example: get rid of n in string python a_string = a_string.rstrip("\n")