To remove a trailing newline from a string in Python, you can use the rstrip() method.
To remove the trailing delimiter from a delimited string in PHP, you can use the rtrim function.