Home  |  Delphi .net Home  |  System.Globalization.RegionInfo  |  ToString Method
  
ToString  
Method  
Returns a string containing the Country/Region Name
RegionInfo Class
System.Globalization NameSpace
CF1.  Function ToString : String;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns a string containing the Country/Region Name. This is the representative value of the class.
Microsoft MSDN Links
System.Globalization
System.Globalization.RegionInfo
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
Showing the ToString method and all of the class Properties
program Project1;
{$APPTYPE CONSOLE}

uses
  System.Globalization;

var
  britishRegionInfo  : System.Globalization.RegionInfo;
  americanRegionInfo : System.Globalization.RegionInfo;

begin
  // Create 3 regions
  britishRegionInfo  := System.Globalization.RegionInfo.Create('Gb');
  americanRegionInfo := System.Globalization.RegionInfo.Create('US');

  // Display information about Britain :
  Console.WriteLine('Britain :');
  Console.WriteLine;
  Console.WriteLine('ToString                     : ' +
                    britishRegionInfo.ToString);
  Console.WriteLine('CurrencySymbol               : ' +
                    britishRegionInfo.CurrencySymbol);
  Console.WriteLine('ISOCurrencySymbol            : ' +
                    britishRegionInfo.ISOCurrencySymbol);
  Console.WriteLine('Name                         : ' +
                    britishRegionInfo.Name);
  Console.WriteLine('EnglishName                  : ' +
                    britishRegionInfo.EnglishName);
  Console.WriteLine('DisplayName                  : ' +
                    britishRegionInfo.DisplayName);
  Console.WriteLine('TwoLetterISORegionName       : ' +
                    britishRegionInfo.TwoLetterISORegionName);
  Console.WriteLine('ThreeLetterISORegionName     : ' +
                    britishRegionInfo.ThreeLetterISORegionName);
  Console.WriteLine('IsMetric                     : ' +
                    britishRegionInfo.IsMetric.ToString);
  Console.WriteLine('ThreeLetterWindowsRegionName : ' +
                    britishRegionInfo.ThreeLetterWindowsRegionName);

  // Display information about America :
  Console.WriteLine;
  Console.WriteLine('America :');
  Console.WriteLine;
  Console.WriteLine('ToString                     : ' +
                    americanRegionInfo.ToString);
  Console.WriteLine('CurrencySymbol               : ' +
                    americanRegionInfo.CurrencySymbol);
  Console.WriteLine('ISOCurrencySymbol            : ' +
                    americanRegionInfo.ISOCurrencySymbol);
  Console.WriteLine('Name                         : ' +
                    americanRegionInfo.Name);
  Console.WriteLine('EnglishName                  : ' +
                    americanRegionInfo.EnglishName);
  Console.WriteLine('DisplayName                  : ' +
                    americanRegionInfo.DisplayName);
  Console.WriteLine('TwoLetterISORegionName       : ' +
                    americanRegionInfo.TwoLetterISORegionName);
  Console.WriteLine('ThreeLetterISORegionName     : ' +
                    americanRegionInfo.ThreeLetterISORegionName);
  Console.WriteLine('IsMetric                     : ' +
                    americanRegionInfo.IsMetric.ToString);
  Console.WriteLine('ThreeLetterWindowsRegionName : ' +
                    americanRegionInfo.ThreeLetterWindowsRegionName);

  Console.ReadLine;
end.
   Britain :
  
   ToString                     : GB
   CurrencySymbol               : ?
   ISOCurrencySymbol            : GBP
   Name                         : GB
   EnglishName                  : United Kingdom
   DisplayName                  : United Kingdom
   TwoLetterISORegionName       : GB
   ThreeLetterISORegionName     : GBR
   IsMetric                     : True
   ThreeLetterWindowsRegionName : GBR
  
   America :
  
   ToString                     : US
   CurrencySymbol               : $
   ISOCurrencySymbol            : USD
   Name                         : US
   EnglishName                  : United States
   DisplayName                  : United States
   TwoLetterISORegionName       : US
   ThreeLetterISORegionName     : USA
   IsMetric                     : False
   ThreeLetterWindowsRegionName : USA
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author