Sunday 29 July 2018

python - How can I remove a trailing newline?

What is the Python equivalent of Perl's chomp function, which removes the last character of a string if it is a newline?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...