Culture.isNeutral

Property. Retrieves a value indicating whether the current instance is a neutral culture.

class Culture
@property const
bool
isNeutral
()

Return Value

Type: bool

true is the current Culture represents a neutral culture; otherwise, false.

Examples

The following example displays which cultures using Chinese are neutral.

import tango.io.Print, tango.text.locale.Common;

void main() {
  foreach (c; Culture.getCultures(CultureTypes.All)) {
    if (c.twoLetterLanguageName == "zh") {
      Print(c.englishName);
      if (c.isNeutral)
        Println("neutral");
      else
        Println("specific");
    }
  }
}

// Produces the following output:
// Chinese (Simplified) - neutral
// Chinese (Taiwan) - specific
// Chinese (People's Republic of China) - specific
// Chinese (Hong Kong S.A.R.) - specific
// Chinese (Singapore) - specific
// Chinese (Macao S.A.R.) - specific
// Chinese (Traditional) - neutral

Meta