GIAC GIAC Secure Software Programmer - C#.NET GSSP-.NET Question # 98 Topic 10 Discussion

GIAC GIAC Secure Software Programmer - C#.NET GSSP-.NET Question # 98 Topic 10 Discussion

GSSP-.NET Exam Topic 10 Question 98 Discussion:
Question #: 98
Topic #: 10

You work as a Software Developer for ABC Inc. The company has several branches worldwide. The company uses Visual Studio .NET 2005 as its application development platform. You are creating an application using .NET Framework 2.0. The application will be used by all the branches of the company. You are using the CompareInfo class for culture-sensitive string comparisons. You write the following code in the application:

String s1 = "C rtify";

String s2 = "c rtify";

String s3 = "c rtify";

You need to compare the s1 string with the s2 string and ensure that the string comparison must ignore case. Which of the following code segments will you use to accomplish the task?


A.

CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;

Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.IgnoreCase));


B.

CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;

Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.None));


C.

CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;

Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.Ordinal));


D.

CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;

Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.OrdinalIgnoreCase));


Get Premium GSSP-.NET Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.