PrepAway - Latest Free Exam Questions & Answers

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?

PrepAway - Latest Free Exam Questions & Answers

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.

One Comment on “Which code segment should you use?


Leave a Reply