The foreach Loop

 

The Double Backslash

For those who detest placing two backslashes in a string to show that one backslash is indeed required in the string, for example:

 strFilename = new string("C:\Program Files\KT\Masterfile.txt"); 

You can show the compiler that the backslashes are a part of the string (not control characters ) by using the @ character:

 strFilename = new string(@"C:\Program Files\KT\Masterfile.txt"); 

Note that the @ is in front of the string, not inside the string.

 


Unlocking Microsoft C# V 2.0 Programming Secrets
Unlocking Microsoft C# V 2.0 Programming Secrets (Wordware Applications Library)
ISBN: 1556220979
EAN: 2147483647
Year: 2005
Pages: 129

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