From: "M. Edward (Ed) Borasky" Date: 2007-04-19T23:28:47+09:00 Subject: Re: How to count a word in a line Yusuf Celik wrote: > Sorry made a mistake > line=gets.chomp > cnt = 0 > line.split.each { > |v| > if v == 'Hi' then > cnt +=1 > end > } > puts "#{cnt}" > > Isn't there some totally unreadable regex that does this? :) -- M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P) http://borasky-research.net/ If God had meant for carrots to be eaten cooked, He would have given rabbits fire.