Remove character from character array ?
Hi,
I needed function to remove some characters from character array.
As always I looked in C Run-Time library, string manipulation functions
section -
and found nothing which contains trim or even remove !
Where to find such a simple function ?
(I'm not using MFC or .NET)
thanks
Vilius
[331 byte] By [
Vilius] at [2007-12-22]
My intention is to shift array elements left and thats it, and I know how to do that manually.
Still hope to find function.
If portability is important, you can also use the STL remove algorithm as follow:
#include <algorithm>
void InPlaceRemove( char* pToModify, char toRemove )
{
char* pLast = std::remove( pToModify, pToModify + strlen(pToModify), toRemove );
*pLast = '\0';
}