In article , Andreas Röhler wrote: > Matthew Dempsky wrote: > > On Wed, Dec 9, 2009 at 9:33 AM, Andreas Röhler > > wrote: > >> But simply by convention, isn't it? > > > > No. It's because it's consistent and makes sense. That's why every > > sane programming language does it this way: > > > > C: s = "foo", strstr(s, "") evaluates to s > > > CMIIW but does this example above not mean, it returns > the string? So far quite different from the rest? Not really. It's just that strstr() reports a successful match by returning a pointer to the first character of the match; the other functions return the position. They're isomorphic. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***