maxon::String is the universal string class of the MAXON API. Is is based on maxon::StringInterface and maxon::StringTemplate.
A maxon::String can easily be created on the stack and constructed using the "+=" operator:
A maxon::String can also be constructed with:
Integer values can be added to the maxon::String with:
A maxon::String can also be constructed with FormatString().
A given maxon::String can easily printed to the debug console with DiagnosticOutput() or similar functions. See Debug and Output Functions.
It is easily possible to iterate over all characters stored in a given maxon::String:
The content of the maxon::String can also be accessed with these functions:
A maxon::String can be edited with:
A maxon::String can be converted to many other data formats but it also can be constructed by converting another data type to a maxon::String.
A maxon::String can be converted to a upper-case or lower-case version of itself:
See also MAXON_CONSTEXPR_TOLOWER.
If the maxon::String describes a numeric value, this value can be converted to a numeric data type:
Also numbers can be converted to a maxon::String:
See also maxon::StringConversion.
If needed, a maxon::String can be converted to a C-string. This might be useful to convert it into std:string
.
The content of the maxon::String can also be converted into special encodings:
Values of enumeration classes can be converted to maxon::String using a function template defined with the MAXON_ENUM_LIST / MAXON_ENUM_ORDERED_LIST attributes:
Further functions are:
A given maxon::String can be compared with another maxon::String:
The comparison modes are:
A defined substring can be obtained from a given maxon::String.
Often it is useful to remove special characters like space, tab, line feed etc. from a maxon::String.
A typical string operation is to check if a given maxon::String contains given substring.
Further utility functions are:
Substring functions use maxon::StringPosition and maxon::StringCount to define the needed arguments.
A StringPosition object defines a position within a maxon::String.
A StringCount object defines a range of characters within a maxon::String.