Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Suppose when i entered string like 'aonnet\ram' if it's entered it's will be accessed but when i entered 'ram' it will be shown an error message

In the string between '\' sign is come mandatory.it's not come it's shows an error message

Please share your information
Posted
Updated 6-Aug-13 18:56pm
v3
Comments
Thanks7872 6-Aug-13 5:53am    
Please share more information
Maciej Los 6-Aug-13 5:53am    
What kind of error message? What kind of string?
jaideepsinh 6-Aug-13 6:04am    
Can you explain in brief?
[no name] 6-Aug-13 7:56am    
Your requirement is not clear.
Sadique KT 7-Aug-13 2:03am    
post your code..

1 solution

use @ before the string
JavaScript
string test = @"abc\xyz";
 
Share this answer
 
Comments
Ankur\m/ 6-Aug-13 7:27am    
The OP isn't using a backslash (\). He is using a front slash which is valid in C#.

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