Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!bywater!arnor!news From: pierce@watson.ibm.com Newsgroups: alt.hackers Subject: Re: Useful string function Message-ID: <1991Jun26.164123.6281@watson.ibm.com> Date: 26 Jun 91 16:41:23 GMT References: <27187@ttidca.TTI.COM> Sender: news@watson.ibm.com (NNTP News Poster) Organization: IBM T.J. Watson Research Center Lines: 15 Approved: yes Nntp-Posting-Host: larios From article <27187@ttidca.TTI.COM>, by hollombe@ttidca.TTI.COM (The Polymath): > Here's a simple minor hack I threw together. It's proved so useful, I'm > amazed it isn't part of the standard Unix libraries. (C'mon. Even BASIC > does this)! Anyway, it's a function that finds a substring within a > string and returns its starting location or -1 if the substring isn't > there. It may not be part of ANSI C, but every halfway respectable compiler I've ever used has had a strstr() function that returns a pointer to the substring. -- ____ Tim Pierce / They call television a medium. That is \ / pierce@watson.ibm.com / because it is neither rare nor well done. \/ twpierce@amh.amherst.edu / -- Ernie Kovacs