最佳答案
This works for any strings that have whitespaces in them
str.downcase.tr!(" ", "_")
but strings that dont have whitespaces just get deleted
So "New School" would change into "new_school" but "color" would be "", nothing!