Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9215055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:06:57+00:00 2026-06-18T02:06:57+00:00

I am currently attempting to remove unwanted characters from a string within my C#

  • 0

I am currently attempting to remove unwanted characters from a string within my C# code.

The remove of the \ character, but it is removing too much. Below is a example of the string

“[{ \”attributes\” : { \”SR_ID\” : \”200003172375\”,
\”Fath_SR\” : \”EH0036\”, \”UPRN\” : \”100100024250\”,
\”Eastings\” : \”260376\”, \”Northings\” : \”358150\”,
\”Disgrifiad\” : \”Test\”, \”Date\” : \”25/01/2012\”,
\”Time\” : \”11:36\” }, \”geometry\” : { \”x\” :
270315, \”y\” : 345828 } }]”

I am attempting to remove the \ character, but leave the “. The only way I have been able to remove the \ is by using

 sReturn = sReturn.Replace("\"",String.Empty);

But this removes the ” character.

I have tried the two attempts below, but for some reason it does not want to do as it told!

 sReturn = sReturn.Replace(@"\",String.Empty);
 sReturn = sReturn.Replace("\\",String.Empty);

Is there a way I could replace the \” with a “?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:06:58+00:00Added an answer on June 18, 2026 at 2:06 am

    Assuming you really DO have \" characters in your string and aren’t just looking at an escaped representation, you can simply do:

    sReturn = sReturn.Replace("\\\"","\"");
    

    If you want to unescape all possible types of escape sequences, use:

    sReturn = Regex.Unescape(sReturn);
    

    But as others have pointed out, you probably don’t really have these characters, and are just looking at a representation where it is shown in the escaped form, such as in visual studio debugger.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently attempting to remove a number of .Resolve(s) in our code. I
So I'm attempting to remove specific parameters from the URL query string that are
I am currently attempting to implement a custom gridview interface to display data from
I'm currently attempting to code one for part of a college project - binary/hex
I'm currently attempting to use the Windows Powerpack DataRepeater control to display data from
I am encountering an issue when attempting to remove an object from my Core
Currently, I am attempting to retrieve numeric data from different CSV files. I then
I am attempting to rewrite any URL with _excaped_fragment_=/some/directory to /some/directory?ajax=1. The code below
so currently what I am attempting to do is, remote onto a different server,
I'm currently attempting to migrate a legacy VBA/Microsoft Access application to Python and PyQt.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.