Method to strip linefeeds

Hi - I imagine there is some easy method but I just can’t find it. I
want to take a string that has \r\n’s in it and replace them with a
space. Anyone know if this is built in?


this is a way
use regular expression

string = " this \r is \n text"

new_string = string.gsub(/\n|\r/, " ")