C++ String Class.
The String class is used to display and manipulate strings and text.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Creating a new Sting object.
String^ string = String::Empty;
Assigning a text value to the string object.
string = "This is a text string";
Replacing a value within a string object.
String^ replacestr = string->Replace("text", "TEXT");
Assigning the string object value to a TextBox Text field.
this->textBox1 ->Text = replacestr;
Changing the String Object value to UpperCase.
String^ replacestr = string->ToUpper();
Changing the String Object value to LowerCase.
String^ replacestr = string->ToLower();
Adding 2 string values with the result in a TextBox Text field.
String^ string = "House";
String^ AddString = "White " + string;
this->textBox1->Text = AddString;
|
|