5.11. Test Your Understanding

 < Day Day Up > 

1:

Which class encapsulates information about a specific culture?

2:

Name two ways to access the default culture within an application.

3:

Match each regular expression:

  1.  @"(\b[^\Wa-z0-9_][^\WA-Z0-9_]*\b)" 

  2.  @"(\b[^\Wa-z0-9_]+\b)" 

  3.  @"(\b[^\WA-Z0-9_]+\b)" 

with the function it performs:

  1. Find all capitalized words.

  2. Find all lowercase words.

  3. Find all words with the initial letter capitalized.

4:

When is it more advantageous to use the instance methods of Regex rather than the static ones?

5:

Which string comparison method(s) is (are) used to implement this statement:

 if (myString == "Monday") bool sw = true; 

6:

Match each statement:

  1.  curdt.ToString("D") 

  2.  curdt.ToString("M") 

  3.  curdt.ToString("ddd MMM dd") 

with its output:

  1. March 9

  2. Tuesday, March 9, 2004

  3. Tue Mar 09

7:

Which of these objects is not created from an existing FileStream?

  1.  FileInfo 

  2.  StreamReader 

  3.  BufferedStream 

8:

You can create a FileStream object with this statement:

 FileStream fs = new FileStream(fname,                    FileMode.OpenOrCreate,                    FileAccess.Write,FileShare.None); 

Which one of the following statements creates an identical FileStream using an existing FileInfo object, fi?

  1.  fs = fi.OpenWrite(); 

  2.  fs = fi.Create(); 

  3.  fs = fi.CreateText(); 

9:

Indicate whether the following comparisons are true or false:

  1.  (string.Compare("Alpha","alpha") >0) 

  2.  (string.Compare("Alpha","alpha",true) ==0) 

  3.  (string.CompareOrdinal("Alpha","alpha")>0) 

  4.  (string.Equals("alpha","Alpha")) 

     < Day Day Up > 


    Core C# and  .NET
    Core C# and .NET
    ISBN: 131472275
    EAN: N/A
    Year: 2005
    Pages: 219

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