SyntaxFix
Write A Post
Hire A Developer
Questions
You can use this :
my_string.strip.gsub(/\s+/, ' ')