Home  |  Delphi .net Home  |  System.Globalization.TextInfo  |  ToUpper Method
  
ToUpper  
Method  
Converts a Char or String to Upper Case according to the current culture
TextInfo Class
System.Globalization NameSpace
CF1.  Function ToUpper ( OneChar : Char ) : Char;
CF2.  Function ToUpper ( Text : String ) : String;
CF : Methods with this mark are Compact Framework Compatible
Description
Converts either a single character OneChar or a whole string Text into upper case according to the language rules of the culture of the TextInfo object.
Microsoft MSDN Links
System.Globalization
System.Globalization.TextInfo
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

uses
  System.Globalization;

var
  gbCulture  : System.Globalization.CultureInfo;
  gbTextInfo : System.Globalization.TextInfo;
  myString   : String;

begin
  // Create a British culture info object
  gbCulture  := CultureInfo.Create('en-GB');

  // Get the TextInfo object from this culture
  gbTextInfo := gbCulture.TextInfo;

  // Display a string in Lower, Upper and Title case
  myString := 'Hello there from Delphi Basics';

  Console.WriteLine('Original   : ' + myString);
  Console.WriteLine;
  Console.WriteLine('Title case : ' + gbTextInfo.ToTitleCase(myString));
  Console.WriteLine('Lower case : ' + gbTextInfo.ToLower(myString));
  Console.WriteLine('Upper case : ' + gbTextInfo.ToUpper(myString));

  Console.ReadLine;
end.
   Original   : Hello there from Delphi Basics
  
   Title case : Hello There From Delphi Basics
   Lower case : hello there from delphi basics
   Upper case : HELLO THERE FROM DELPHI BASICS
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author