strremove.cpp
来自「hl2 source code. Do not use it illegal.」· C++ 代码 · 共 29 行
CPP
29 行
/*----------------------------------------------------------------------
Copyright (c) 1998,1999 Gipsysoft. All Rights Reserved.
Please see the file "licence.txt" for licencing details.
File: strremove.cpp
Owner: russf@gipsysoft.com
Purpose: remove a substring from a larger string.
----------------------------------------------------------------------*/
#include "stdafx.h"
extern bool strremove( LPTSTR pszString, LPCTSTR pcszSub );
bool strremove( LPTSTR pszString, LPCTSTR pcszSub )
//
// Return true if any of pcszSub that have been removed from
// our main string.
{
bool bRetVal = false;
LPTSTR pszSubFound;
const int nSearchLength = _tcslen( pcszSub );
while( ( pszSubFound = _tcsstr( pszString, pcszSub ) ) != NULL )
{
_tcscpy( pszSubFound, pszSubFound + nSearchLength );
pszString = pszSubFound;
bRetVal = true;
}
return bRetVal;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?