std::string 문자 치환 코드


#include <iostream>
#include <algorithm>
#include <string>
#include <functional>

using namespace std;
int main()
{
    string test = "f1=a|f2=b|f3=c";
    replace_if(test.begin(), test.end(), bind2nd(equal_to<char>(), '|'), ',');
    cout << test << endl;

    return 0;
}

아 요새 계속 놀았더니 머리가 자꾸 썩어서 이런 것도 바로 코드가 안 나와-_-

트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://www.xeraph.com/tb/1977762 [도움말]

덧글

댓글 입력 영역