Ruby-on-rails – Checking if string is like another in Rails

regexrubyruby-on-rails

In rails is there a way of doing something like the following…

if @var == "string%"

The % meaning that there can be anything at the end of the string but as long as it starts with "string" it will return true.

Any help is much appreciated.