Click here to Skip to main content
12,762,900 members (38,748 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP .NET
like i want output sting as

Posted 11-Sep-12 20:58pm
Updated 11-Sep-12 21:04pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Here are your two options:
string test1 = @"abscd\fkfdf";
string test2 = "abscd\\fkfdf";
myfusion 12-Sep-12 2:09am
i have tried this its not working
JF2015 12-Sep-12 2:16am
So, what is the error? Compiler error or does it display incorrectly?
myfusion 12-Sep-12 2:17am
yup the output string is abscd\\fkfdf
JF2015 12-Sep-12 2:31am
For both solutions i provided (test1 and test2)?
myfusion 12-Sep-12 2:33am
yup for both of these solution..
i have checked output string during debugging..
actually this string is used somewhere else also.
JF2015 12-Sep-12 2:35am
During debugging (e.g. in the watch window) it definitely shows the two slashes, but it should not show it in the UI.
myfusion 12-Sep-12 2:38am
actually this string is also used in somewhere else..
and at that place i want this with single slash
JF2015 12-Sep-12 2:46am
Where in your UI is this string not correctly displayed. This is all pretty standard and there must be a different problem. Normally when you write @"hello\world" it show one slash and when you write @"hello\\world" it shows two.
myfusion 12-Sep-12 2:49am
this is a string is server name and used in connection string..
JF2015 12-Sep-12 2:53am
Unless you update your question to show more code, it will be hard to help you.
myfusion 12-Sep-12 3:07am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100