RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.LowerCase Function

Converts an ASCII string to lowercase.

Pascal
function LowerCase(const S: string): string; overload;
function LowerCase(const S: string; LocaleOptions: TLocaleOptions): string; overload;
C++
AnsiString LowerCase(const AnsiString S);
AnsiString LowerCase(const AnsiString S, TLocaleOptions LocaleOptions);

SysUtils

LowerCase returns a string with the same text as the string passed in S, but with all letters converted to lowercase. The conversion affects only 7-bit ASCII characters between 'A' and 'Z'. To convert 8-bit international characters, use AnsiLowerCase.  

C++ Examples: 

 

/*
This example uses an edit control, a label, and a button on a
form. When the user clicks the button, the label shows the text of
the edit control in lower case.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Label1->Caption = LowerCase(Edit1->Text);
}

 

Delphi Examples: 

{
This example uses an edit control, a label, and a button on a
form. When the user clicks the button, the label shows the text of
the edit control in lower case.
}
procedure TForm1.Button1Click(Sender: TObject);
begin
  Label1.Caption := SysUtils.LowerCase(Edit1.Text);
end;
{
The following example beeps once for each "beep" passed in
on the command line.  The example terminates the application
if  "exit" is passed in on the command line.  Build the
project to generate a .exe file and then execute that file
from a command line: "ParamCount_proj beep beep exit".
} 
procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
//  Use print statements since you can't use the debugger.
//  MessageDlg(
//    'System ParamCount = ' + IntToStr(System.ParamCount),
//    mtConfirmation, [mbOK], 0);
  for i := 1 to System.ParamCount do
  begin
    if LowerCase(ParamStr(i)) = 'beep' then
      Beep
    else if LowerCase(ParamStr(i)) = 'exit' then
      Application.Terminate;
    Sleep(250);
  end;
end;

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!