Create RegionInfo class based on the country/region associated with the specified culture identifier. : RegionInfo « Internationalization I18N « C# / C Sharp






Create RegionInfo class based on the country/region associated with the specified culture identifier.

 

using System;
using System.Globalization;

public class SamplesRegionInfo  {

   public static void Main()  {

      // Creates a RegionInfo using the ISO 3166 two-letter code.
      RegionInfo myRI1 = new RegionInfo( "US" );

      // Creates a RegionInfo using a CultureInfo.LCID.
      RegionInfo myRI2 = new RegionInfo( new CultureInfo("en-US",false).LCID );

      if ( myRI1.Equals( myRI2 ) )
         Console.WriteLine( "The two RegionInfo instances are equal." );
      else
         Console.WriteLine( "The two RegionInfo instances are NOT equal." );

   }

}

   
  








Related examples in the same category

1.RegionInfo contains information about the country/region.
2.Gets the name, in English, of the currency used in the country/region.
3.Gets the currency symbol associated with the country/region.