Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's the correct syntax for the following c# code
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01037796
Message ID:
01037807
Views:
15
Paul,
Put '@' in front of the strings or use '\\' instead of '\'. Something like this:
if (strURL.Trim().EndsWith(@"\"))
	URL = strURL.Trim()+@"aesys\default.aspx?clearcache=true";
else
	URL = strURL.Trim()+@"\aesys\default.aspx?clearcache=true";
or
if (strURL.Trim().EndsWith("\\"))
	URL = strURL.Trim()+"aesys\\default.aspx?clearcache=true";
else
	URL = strURL.Trim()+"\\aesys\\default.aspx?clearcache=true";
Einar


>
>if (strURL.Trim().EndsWith("\"))
>	URL = strURL.Trim()+"aesys\default.aspx?clearcache=true";
>else
>	URL = strURL.Trim()+"\aesys\default.aspx?clearcache=true";
>
>
>
>the first line gives me the error "newline in constant". And the 2 lines where I'm trying to build the URL give an error "Unrecognized escape sequence"
>
>Thanks
Semper ubi sub ubi.
Previous
Reply
Map
View

Click here to load this message in the networking platform