Which code segment should you use?

You need to generate a report that lists language codes and region codes.
Which code segment should you use?

You need to generate a report that lists language codes and region codes.
Which code segment should you use?

A.
foreach (CultureInfo culture in
CultureInfo.GetCultures(CultureTypes.SpecificCultures)) {
// Output the culture information…}

B.
CultureInfo culture = new CultureInfo(“”);
CultureType types = culture.CultureTypes;
// Output the culture information…

C.
foreach (CultureInfo culture in
CultureInfo.GetCultures(CultureTypes.NeutralCultures)) {
// Output the culture information…}

D.
foreach (CultureInfo culture in
CultureInfo.GetCultures(CultureTypes.ReplacementCultures)) {
// Output the culture information…}

Explanation:
CultureTypes.SpecificCultures will filter all language codes that are specific to a countryregion.
B The CultureInfo object created is not associated with any cultures.
C will yield only neutral cultures, they will not be specific to a countryregion.
D Replacement cultures are user-defined custom cultures.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


mr_tienvu

mr_tienvu

I agree with the answer. A