string::Remove

Description

Remove instances of the input char from the string. Comparisons for the character are case-sensitive.

Syntax

int Remove( char ch )

Parameters

ch
[input]The character to be removed from a string.

Return

The count of characters removed from the string. Zero if the string isn't changed.

Examples

EX1

void string_Remove_ex1()
{
        string str("apple");
        int nRet = str.Remove('p');
        out_int("", nRet);//2
        out_str(str);//"ale"
}

Remark

See Also

string::Replace

header to Include

origin.h