Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Object.toString Method

Returns a string that represents the current object.

public str toString()


A string that represents the current object.

The default implementation returns the class name of the object. The method can be overridden in a derived class to return values that are meaningful for that type.

For example, an instance of the SysMethodInfo Class returns the method name and type of the method (instance or static).

The following example prints out the class name of 'o'.

static void Object_ToString_Job(Args _args)
    Object o = new Object();

    print o.toString();  // Prints out: "Class Object"

Community Additions

© 2015 Microsoft