nerdexam
GIAC

GSSP-NET · Question #13

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…

The correct answer is A. CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo. See the full explanation below for the reasoning.

Question

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?

Options

  • ACompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;
  • BCompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;
  • CCompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;
  • DCompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;

How the community answered

(40 responses)
  • A
    80% (32)
  • B
    5% (2)
  • C
    3% (1)
  • D
    13% (5)

Community Discussion

No community discussion yet for this question.

Full GSSP-NET Practice