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 9019677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:50:23+00:00 2026-06-16T04:50:23+00:00

lines = some stuff\some other \stuff\\; lines = lines.Replace(\, \); lines = lines.Replace(\, \);

  • 0
lines = "some stuff\"some other \"stuff\"\"";
lines = lines.Replace("\"", "\"");
lines = lines.Replace("\"", "\"");

in its current context and in its simplest form these two actions seem absolutely pointless but when I put this into code it will be not be pointless and will have a purpose other than replacing itself with itself.

OK so I have the String lines that has 4 escaped quotation marks and I wish to replace the first quote with a quote and the end quote with a quote how would I accomplish this without replacing any of the inner quotes?

  • 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-16T04:50:24+00:00Added an answer on June 16, 2026 at 4:50 am

    Use IndexOf and LastIndexOf to find the first and last quotes. Then use Substring to replace the quotes:

    lines = "some stuff\"some other \"stuff\"\"";
    firstQuote = lines.IndexOf("\"");
    lastQuote = lines.LastIndexOf("\"");
    lines = lines.Substring(0, firstQuote) + "\"" + lines.Substring(firstQuote + 1, lastQuote) + "\"" + lines.Substring(lastQuote + 1, lines.Length);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My file looks like this: <MAIN> <SUB_MAIN>one</SUB_MAIN> <VER>version#</VER> (OTHER STUFF...) <LOCATION>PATH</LOCATION> </MAIN> <MAIN> <SUB_MAIN>two</SUB_MAIN>
I have a Win Form application that does some boring accounting stuff and then
I have a JTextArea which consists of lines (some of them possibly duplicates of
I have a file containing some lines of code followed by a string pattern.
I want to draw some lines and rectangles on a panel. Sometimes it does
I try to draw some lines with different colors. This code tries to draw
Suppose I have a file containing some lines: line 1 ... line 2 ...
I have been reading over some code lately and came across some lines such
I have a huge file that has some lines that need to have a
I want to setup symlinks and add some lines to system configuration files, I

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.