New answers tagged ruby
-1
I am reading the book aswell and I came up with the following solution,
File.read('text.txt').split(/\n/).each do |t|
p t if t =~ /bleh/
end
Which I think is very nice. I am however also a Ruby-rookie. :)
Top 50 recent answers are included
Related Tags
ruby × 1623ruby-on-rails × 565
beginner × 164
performance × 105
algorithm × 85
active-record × 84
object-oriented × 82
programming-challenge × 76
rspec × 65
strings × 58
array × 54
datetime × 42
unit-testing × 41
game × 34
parsing × 30
regex × 30
validation × 29
controller × 29
time-limit-exceeded × 25
comparative-review × 24
hash-map × 23
api × 23
sorting × 22
formatting × 21
csv × 19