Currently viewing: GipsySoft » Front Page» Articles


Find a sub string using a case insensitive search

char * stristr( char * pszSource, const char * pcszSearch )

Return value

The return value is a pointer to the first occurrence of pcszSearch within pszSource, or NULL if pcszSearch cannot be found.


char szBuf[] = "Mary had a little lamb";
char *pszLamb = stristr( szBuf, "LAMB" );
if( pszLamb )
	//	pszLamb is now a pointer to the word lamb in szBuf.


Click to view the source code

See also none