Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2394
  • Last Modified:

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

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
Christopher Schene
Asked:
Christopher Schene
1 Solution
 
adatheladCommented:
You're not assigning the result back into your variable...
i.e.

DPM_screenSaver_resp = DPM_screenSaver_resp.Replace("\", doubleSlash)
0
 
Christopher ScheneSystem Engineer/Software EngineerAuthor Commented:
Thanks....I should have realized that!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now