TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Carlos Sanchez
NA
264
0
How to concatenate a backslash?
Oct 1 2004 12:18 PM
Hi all! I have a condition that compare two strings n' I heve a problem to concatenate. I heve the below condition: if (myFileInfo.DirectoryName + "\\" != MyPath) The result of the condition must be true but it doesn't run the if statement. I've inserted a breakpoint in this line and the values are the next: myFileInfo.DirectoryName = "C:\Program Files" MyPath = "C:\Program Files\" myFileInfo.DirectoryName + "\\" = "C:\Program Files\\" The problem is the doble backslash. If I write only one (... + "\") an exception is thrown. I tried with the verbatim symbol (... + @"\") n' in the breakpoint the values are the next: myFileInfo.DirectoryName = "C:\Program Files" MyPath = "C:\Program Files\" myFileInfo.DirectoryName + @"\" = error: maneged EE does not understand the expression's syntax Any idea? Taking in mind that I have others conditions n' if I modify Mypath string in the others condition I'd have the same problem) Thanx in advance Regards
Reply
Answers (
3
)
DBConcurrencyException not working!!
Data Base as a variable