Solved

How do I replace back slash with double back slash in vb.net string

Posted on 2008-10-23
2
2,257 Views
Last Modified: 2012-05-05
I have the attached code snippit and I want to replace the "\" with "\\" but the code does not work.

Why?

there is probaby a very simple answer

I tried
Dim doubleSlash As String = Chr(92) & Chr(92)
                DPM_screenSaver_resp.Replace("\", doubleSlash)

Open in new window

0
Comment
Question by:Christopher Schene
2 Comments
 
LVL 23

Accepted Solution

by:
adathelad earned 250 total points
ID: 22790248
You're not assigning the result back into your variable...
i.e.

DPM_screenSaver_resp = DPM_screenSaver_resp.Replace("\", doubleSlash)
0
 

Author Comment

by:Christopher Schene
ID: 22790865
Thanks....I should have realized that!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

856 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