• Post Reply Bookmark Topic Watch Topic
  • New Topic

easier way for this?  RSS feed

 
Adam Jones
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

is there an easier way to get this done?
thanks for any help
adam
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't that return -1 for anything other than "economy"?
 
Karthikeyan Rajendraprasad
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[/qb]<hr></blockquote>
it should be like

now only it will work for all the cases
[ August 05, 2003: Message edited by: Karthikeyan Rajendraprasad ]
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!