Solved

CString Replace

Posted on 2006-11-30
2
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
post4 challenge 28 121
Detect file exist or not 3 215
Trying to run powershell  in a batch file. How do I do this? 8 122
Capture logon name 13 119
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: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Suggested Courses

739 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