Algorithm delete some charactors from string
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Algorithm delete some charactors from string相关的知识,希望对你有一定的参考价值。
bool IsCharBelongString( IN const char* szIn, IN char ch ) { if (szIn) { while (*szIn) { if (ch == *szIn) { return true; } szIn++; } } return false; } void DeleteChar( IN char* szIn, IN const char* szDelete ) { if (szIn) { char* pStep1 = szIn; char* pStep2 = szIn; while (*pStep1) { if (!DIYIsCharBelongString(szDelete, *pStep1)) { *pStep2++ = *pStep1; } pStep1++; } *pStep2 = 0; } }
以上是关于Algorithm delete some charactors from string的主要内容,如果未能解决你的问题,请参考以下文章
Some features we need to keep in mind about the implementation of QuickSort algorithm