473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

What is the @ at symbol for?

In this code:

XmlTextWriter myWriter = new XmlTextWriter(@"C:\Xmldata\myWriter.xml",
null);
Why do they have the @ at symbol? Why not just the string?

Nov 17 '05 #1
4 9759
for the special character in the string
for example \ in the string you have to use \\ or @"\"

byez
imperugo (exCartman)
myblog : http://imperugo.blogspot.com
<ne***********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
In this code:

XmlTextWriter myWriter = new XmlTextWriter(@"C:\Xmldata\myWriter.xml",
null);
Why do they have the @ at symbol? Why not just the string?

Nov 17 '05 #2
ne***********@gmail.com wrote:
In this code:

XmlTextWriter myWriter = new XmlTextWriter(@"C:\Xmldata\myWriter.xml",
null);
Why do they have the @ at symbol? Why not just the string?


http://www.yoda.arachsys.com/csharp/...batim.literals
Nov 17 '05 #3
You can also use it in front of any variable name to allow keywords to
be used as variables. This is legal C#:

public bool DontDoThis()
{
bool @true = false;
return @true == true;
}

Brian

ne***********@gmail.com wrote:
In this code:

XmlTextWriter myWriter = new XmlTextWriter(@"C:\Xmldata\myWriter.xml",
null);
Why do they have the @ at symbol? Why not just the string?


Nov 17 '05 #4
The @ symbol specifies that the string will be used literally so that you
can type @"c:\foo\bar" instead of "c:\\foo\\bar". Be aware however that
double quotes are needed if you wish to include quote marks in your string.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

<ne***********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
In this code:

XmlTextWriter myWriter = new XmlTextWriter(@"C:\Xmldata\myWriter.xml",
null);
Why do they have the @ at symbol? Why not just the string?

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Troll | last post by:
Hi, This is related to my previous post but I made it much simpler... open (INFILE, "test.txt"); while (<>) { print $_; s/one/two/g; print $_; }
0
by: Richard | last post by:
I am setting up HS in 8i, when I go to $ORACLE_HOME/bin and do a ldd hsodbc i get the below error message, I have done a relink to recreate the hsodbc executable but still no luck. I do have a tar...
0
by: John Graat | last post by:
Hi all, I've built the STLport-462 library on AIX-4.3.3 using gcc-3.3.2. No errors during compilation. However, during linking the following error occurs: ld: 0711-317 ERROR: Undefined symbol:...
9
by: Prasad | last post by:
HI, I am a beginner in VC++.. I am trying to write a Win32 console application in visual studio.. I am using following header files.. #include <STRING> using namespace std; #include...
2
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include...
1
by: vsp15584 | last post by:
Hii..i use the coding as below :- import java.applet.applet; import java.awt.*; import com.sun.j3d.utils.applet.mainframe; import com.sun.j3d.utils.universe.*; import...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
1
by: yamitmehta | last post by:
When I compile to code using g++arm of VxWorks 5.5 and put it on my board i get the follwing undefined symbols:- Cpool and Csingleton are template classes. CPool has the static member...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
3
by: Sindhu Rani | last post by:
i hav created 3 classes in 3 different files. am gettin an error durin compilation. wat shud i do??? C:\s\source>javac -d ..\classes devtestdrive.java devtestdrive.java:5: cannot resolve symbol...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.