Description
The ToSimpleString
method is a static extension method provided by the SandboxSystemExtensions
class. It is used to convert a System.Type
object into a simplified string representation. This method allows you to optionally include the namespace in the output string.
Usage
To use the ToSimpleString
method, you need to pass a System.Type
object as the first parameter. The second parameter is a boolean value that determines whether the namespace should be included in the resulting string. If includeNamespace
is set to true
, the namespace will be included; otherwise, it will be omitted.
Example
// Example usage of ToSimpleString method
Type myType = typeof(Sandbox.GameObject);
string simpleString = SandboxSystemExtensions.ToSimpleString(myType, true);
// Output: "Sandbox.GameObject" if includeNamespace is true
// Output: "GameObject" if includeNamespace is false