Wouldn't that return -1 for anything other than "economy"? No, it will return 0 for e, ec, eco, econ, econo, econom, economy, and uppercase (or mixed case) versions of these.
now only it will work for all the cases Did you
test those other cases beforehand? Ernest's code will work fine.
If you like, here's another way:
or maybe