Ruby Highlight
Ruby
code posted
created at 10 Jan 00:42, updated at 16 Jan 13:14
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
array = [] File.open(file.txt) do |f| f.lines.each do |line| array << line.split.map(&:to_s) end end puts purgeObject @test = { "strings" => array }.to_json puts @test |
195 Bytes in 2 ms with coderay