UpCase (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

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

Code

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  // Get string from TEdit control.
  UnicodeString s = Edit1->Text;
  for (int i = 1; i <= s.Length(); i += 2)
	s[i] = System::UpCase(s[i]);
  Edit1->Text = s;
}

Uses

Personal tools
Assistance