Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP .NET
like i want output sting as
 
abscd\fkfdf
Posted 11-Sep-12 19:58pm
Edited 11-Sep-12 20:04pm
v2

1 solution

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

Solution 1

Here are your two options:
string test1 = @"abscd\fkfdf";
string test2 = "abscd\\fkfdf";
  Permalink  
Comments
myfusion at 12-Sep-12 2:09am
   
i have tried this solution.bt its not working
JF2015 at 12-Sep-12 2:16am
   
So, what is the error? Compiler error or does it display incorrectly?
myfusion at 12-Sep-12 2:17am
   
yup the output string is abscd\\fkfdf
JF2015 at 12-Sep-12 2:31am
   
For both solutions i provided (test1 and test2)?
myfusion at 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 at 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 at 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 at 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 at 12-Sep-12 2:49am
   
this is a string is server name and used in connection string..
JF2015 at 12-Sep-12 2:53am
   
Unless you update your question to show more code, it will be hard to help you.
myfusion at 12-Sep-12 3:07am
   
thanks...

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

  Print Answers RSS
0 CHill60 330
1 OriginalGriff 285
2 CPallini 198
3 BillWoodruff 170
4 Sergey Alexandrovich Kryukov 168


Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2014
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