Solved

CString Replace

Posted on 2006-11-30
2
249 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
ID: 18048672
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
ID: 18048693
Cheers!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Installing Microsoft R server on REDHAT or SUSE Linux 4 137
sum13 challenge 24 107
sum28 challenge 31 112
JQuery serialize and unserialize 8 79
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…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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