Re: match()
- Posted by Juergen Luethje <j.lue at gmx.de> May 26, 2003
- 441 views
Hello Aku, you wrote: > match("", "something") shows an error > first argument of match() must be a non-empty sequence > > I think it should return 1, The equivalent function to match() in BASIC is instr(), and that's actually the way instr() works. My experience after about 10 years programming in BASIC is, that this often causes problems. Especially it can cause bugs, that are very hard to find by beginners. > because "" is a substring of "something", > and is located in any position. This is a philosophical question, isn't it? > So I don't have to check if the first argument is "", don't call > match(). > > How do you think? Best regards, Juergen -- /"\ ASCII ribbon campain | "Everything should be made as simple \ / against HTML in | as possible, but not simpler." X e-mail and news, | / \ and unneeded MIME | http://www.sfheart.com/einstein.html