You are developing a .NET Framework 2.0 Windows Forms application that will be used by several
Domain.com employees in several countries on a workstation used as collateral.
The application is required to fully support customization of the user interface based on the user’s preferences
like the language currency and date and time formats.
You are required to write code that will compare the name of two employees which are stored in variables named employee1 and employee2.
You are required to ensure correct comparisons whilst taking care of the regional settings selected.
What should you do?
A.
The String.Compare(Fileemployee1, Fileemployee2, true,CultureInfo.CurrentCulture) segment should be used
B.
The String.Compare(Fileemployee1, Fileemployee2, true,CultureInfo.InvariantCulture) segment should be used
C.
The String.Compare(Fileemployee1, Fileemployee2, true,CultureInfo.InstalledUICulture) segment should be used
D.
The String.Compare(Fileemployee1, Fileemployee2, true,CultureInfo.CurrentUICulture) segment should be used
Explanation:
The default behavior of the segment in question is to perform culture-sensitive comparisons and
should definitely be considered for use in the scenario.
Incorrect Answers:
B: This code segment is incorrect and should not be used in the scenario because it will lead to culture-insensitive operations.
C: This code segment is incorrect and should not be used in the scenario because this will used the culture that is installed with the operating system.
D: This code segment is incorrect and should not be used in the scenario because this settings only used for changing the user’s interface culture used by a thread.
I have the same idea. A