⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stristr.cpp

📁 hl2 source code. Do not use it illegal.
💻 CPP
字号:
/*----------------------------------------------------------------------
Copyright (c) 1998,1999 Gipsysoft. All Rights Reserved.
Please see the file "licence.txt" for licencing details.
File:	stristr.cpp
Owner:	russf@gipsysoft.com
Web site: http://www.gipsysoft.com
Purpose:	Case insensitive test to see if a string is contained
					within another.
					It will fault if either of the strings are NULL.
----------------------------------------------------------------------*/
#include "stdafx.h"

extern LPTSTR stristr( LPTSTR pszSource, LPCTSTR pcszSearch );

LPTSTR stristr( LPTSTR pszSource, LPCTSTR pcszSearch )
//
//	Return a pointer to the start of the search string
//	If pszSource does not contain pcszSearch then returns NULL.
{
	const int nLength = _tcslen( pcszSearch );
	while( *pszSource )
	{
		if( !_tcsnicmp( pszSource, pcszSearch, nLength ) )
			break;
		pszSource++;
	}

	if( !( *pszSource ) )
	{
		pszSource = NULL;
	}
	return pszSource;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -