Can anyone help me, how to remove the trailing white spaces from each line in a string in ruby.... For example:
str = "Hello everyone. \nHope you guys are doing good \nstrange i can't remove this spaces"
I tried rstrip but its not working for me.... May be have to try gsub.... I want the answer to be in below wayy.
"Hello everyone.\nHope you guys are doing good\nstrange i can't remove this spaces"
\n.