問題:
I want to change every value in a hash so as to add '%' before and after the value so我想更改散列中的每個值,以便在值前後添加 '%'
{ :a=>'a' , :b=>'b' }
must be changed to必須改爲
{ :a=>'%a%' , :b=>'%b%' }
What's the best way to do this?做到這一點的最佳方法是什麼?
解決方案:
參考一: https://en.stackoom.com/question/Llw9參考二: https://stackoom.com/question/Llw9