human
remove (chomp) a newline
assistant
Here is some code to remove newline in string "Hello\n\n\n" on the right side

'Hello\n\n\n'.rstrip('\n')

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.