Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
like i want output sting as

abscd\fkfdf
Posted
Updated 14-Jun-18 0:58am
v2

Here are your two options:
C#
string test1 = @"abscd\fkfdf";
string test2 = "abscd\\fkfdf";
 
Share this answer
 
Comments
myfusion 12-Sep-12 2:09am    
i have tried this solution.bt 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.
In VB.NET
Dim DomainAndUsername As String= initShortDomainName & "\" & lg_username.Text

In C#
string DomainAndUsername =string.Concat(initShortDomainName , @"\" , lg_username.Text);
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900