#include <algorithm>
#include <string>
using namespace std;
int main()
{
cout << "Hello World" << endl;
string str = "ab0cd0e0fg";
replace_if(str.begin(),str.end(),bind2nd(equal_to<char>(),char('0')),char('-'));
cout << str << endl;
return 0;
}
output:
ab-cd-e-fg
0 개의 댓글:
댓글 쓰기