Hi folks! Have you ever thought about removing new line “\n” and all whitespaces from a string? The magic we need is in Ruby “gsub” function: " My string\n ".gsub("\n","").strip the first gsub removes all newline characters while the second one removes all whitespaces; so the result will be Mystring isn’t it simple? If […]
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.