RAD Studio Athens

1.709

Description

The following code changes the capitalization of every other character in the text of an edit control to uppercase when you click the button.

Code

procedure TForm1.Button1Click(Sender: TObject);
var
  s : string;
  i : Integer;
begin
  { Get string from the TEdit control. }
  s := Edit1.Text;
  for i := 1 to Length(s) do
    if i mod 2 = 0 then s[i] := System.UpCase(s[i]);
  Edit1.Text := s;
end;

Uses