Section 3.6. Strings


3.6. Strings

It is nearly impossible to write a C# program without creating strings . A string object holds a series of characters .

You declare a string variable using the string keyword much as you would create an instance of any type:

 string myString; 

You specify a string literal by enclosing it in double quotes:

 "Hello World" 

It is common to initialize a string variable that contains a string literal:

 string myString = "Hello World"; 

Strings will be covered in much greater detail in Chapter 15.



Learning C# 2005
Learning C# 2005: Get Started with C# 2.0 and .NET Programming (2nd Edition)
ISBN: 0596102097
EAN: 2147483647
Year: 2004
Pages: 250

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net