|
-
Oct 22nd, 2010, 03:40 AM
#1
Thread Starter
Addicted Member
[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
Failing to plan is Planning to fail 
-
Oct 22nd, 2010, 05:04 AM
#2
Re: split and replace using VC++ in MFC
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Oct 22nd, 2010, 07:18 AM
#3
Thread Starter
Addicted Member
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
Failing to plan is Planning to fail 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|