Re: Prune double slahes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



To Marc's point, are the slashes even there at all? Isn't the compiler trying to escape out the characters before it?

Try:
<appSettings>
<add key="pdfroot" value="p:\\E-Switch Secure\\PDF_dwgs\\"/>
</appSettings>
string path = ConfigurationManager.AppSettings["pdfroot"];

Tossing that to a Textbox would display:

"p:\E-Switch Secure\PDF_dwgs\"

--
Reproduced, simplistically, with:

string pathname = "p:\\E-Switch Secure\\PDF_dwgs\\";
output.Text = pathname;

value from output.text in presentation: p:\E-Switch Secure\PDF_dwgs\

---

-dl

---
David Longnecker
Web Developer
http://blog.tiredstudent.com

But... unless I am missing something, it doesn't contain any double
slashes... is this just a debugger issue? It displays strings in the
escaped form, so \ appears \\. But it is still \.

Marc



.



Relevant Pages

  • Re: r""
    ... I have decided to build a tool to help us sync files in UNC paths. ... slashes are going to escape stuff in the string, ... Python's string is never escaped in-memory, ...
    (comp.lang.python)
  • Re: oniguruma : cant get it to search for (backslash)
    ... ArgumentError: Oniguruma Error: end pattern at escape ... In a regex literal a backslash is a metacharacter, ...
    (comp.lang.ruby)
  • Re: [PHP] preg_match() returns false but no documentation why
    ... want but you must escape it in if it appears in the regex. ... The error function may retuyrn 0, but which of the following constants ... Now when I add the slashes, I get zero, even though I give it a real value ...
    (php.general)
  • Re: r""
    ... I have decided to build a tool to help us sync files in UNC ... config file), the UNC slashes are going to escape stuff in the string, ...
    (comp.lang.python)
  • How: Ampersand in AppSettings value??
    ... I am wondering how i can put an ampersand character into the value attribute ... of a key in the appSettings section of my web.config file. ... I've tried to escape the character as "\&" but that didnt do anything. ...
    (microsoft.public.dotnet.framework.aspnet.security)