Solved

CString Replace

Posted on 2006-11-30
2
245 Views
Last Modified: 2013-11-20
Hi guys,

I have a CString, which contains the following:


"C:\folder\folder\/folder/file.doc"

As you noticed, there is a: "\/" in the folder path, I need to do a find and replace for "/" and replace with "\"

Could somebody help me out please?

Cheers!
0
Comment
Question by:Cyber-Drugs
2 Comments
 
LVL 14

Accepted Solution

by:
wayside earned 500 total points
Comment Utility
CString foo = "C:\\folder\\folder\\/folder/file.doc";

foo.Replace('/', '\\');      // convert / to \
foo.Replace("\\\\", "\\");// convert any \\ to \
0
 
LVL 4

Author Comment

by:Cyber-Drugs
Comment Utility
Cheers!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now