>

Output hash to string then remove the key and gsub

- 编辑:www.bifa688.com -

Output hash to string then remove the key and gsub

myHash = { 1920 => 'value for 1920', 1925 => 'value for 1925', 1934 => 'value for 1934' }

novels = myHash.to_s # => '1925value for 19251920value for 19201934value for 1934'
novels.gsub(/d{4}/, ' ' ) { |token| print token } # => ' value for 1925 value for 1920 value for 1934'

本文由必发88手机版发布,转载请注明来源:Output hash to string then remove the key and gsub