본문 바로가기
Programming/MFC,C++

c++글자 변경 string

by 기적 2013. 6. 28.

void ReplaceString( std::string & strCallId, const char * pszBefore, const char * pszAfter )

{

size_t iPos = strCallId.find( pszBefore );

size_t iBeforeLen = strlen( pszBefore );

while( iPos < std::string::npos )

{

strCallId.replace( iPos, iBeforeLen, pszAfter );

iPos = strCallId.find( pszBefore, iPos );

}


함수 추가


ReplaceString(t_value1," ","\n");


( 문자열, 찾는 글자, 바꿀 글자);

끝!

댓글