MString name = "John Doe"; // initialization with a string literal MString emptyString; // initialization with a default constructor
MString firstName = "John"; MString lastName = "Doe"; MString fullName = firstName + " " + lastName; // concatenation using '+' operator
MString name = "John Doe"; const char* nameCString = name.asChar(); // conversion using 'asChar()' function
MString a = "hello"; MString b = "world"; if (a == b) { // do something } else { // do something else }The MString class is a part of the Maya C++ API, which is included in the Maya SDK package library.