From: 7stud -- Date: 2011-09-12T10:19:05+09:00 Subject: Re: making an array of strings Joe Collins wrote in post #1021260: > Also, I want to read words from a file and make them an array of > strings. I can read files fine but making an array of strings is where I > am > stumped. > text.txt: ---- hello world dog boy girl child cat ---------- File.open('text.txt') do |f| p f.read.split.sort end --output:-- ["boy", "cat", "child", "dog", "girl", "hello", "world"] -- Posted via http://www.ruby-forum.com/.