我想知道是否可以将包含字符串的数组转换为具有此字符串的Hash。
例如: arr = [" k1"," k2"," k3"]到hs = {:k1 => "不在乎",:k2 => " ...",:k3 =>" ..."}
我试过哈希[" k1"," k2"]但不是我正在寻找:)
抱歉,我忘记了语言,是" Ruby"
提前感谢您的时间