if /#{var1}/ =~ line
when i enter # thats just comments out the whole line
any reason for using #
Jeremy McAnally wrote:
> You can use string interpolation like you can with double quoted
> strings.
>
> var1 = "hello"
>
> File.foreach "file.txt" do |line|
> if /#{var1}/ =~ line
> puts "found it"
> break
> end
> end
>
--
Posted via http://www.ruby-forum.com/.