[RESOLVED] split and replace using VC++ in MFC
Hi,
I am a new in MFC applciation. I have a string "ABC-C_IF_2_6". First i find out the "-" and split two strings like ABC and C_1F_2_6. Second thing i need to replace comma (",") instead of underscore ("_") and my output look like C,1F,2,6 instead of C_1F_2_6. What is the function need to use these condition in vc++. How can we done it? In .net i can do using split function and replace the operator. How will do in vc++. If any option available, help me.
It is very urgent.
Hope your's reply.
Thanks
Re: split and replace using VC++ in MFC
Re: split and replace using VC++ in MFC
Hi,
Thanks for your reply. I got the code.
CString s(_T(strClearanceValue));
int i = s.Find(_T('-'));
CString sLeft = s.Left(i);
CString sRight = s.Right(s.GetLength() - i - 1);
sRight.Replace(_T('_'), _T(','));
It is working fine.
Thanks