다음을 통해 공유


Objects.ToString Method

Definition

Overloads

ToString(Object)

Returns the result of calling toString for a non-null argument and "null" for a null argument.

ToString(Object, String)

Returns the result of calling toString on the first argument if the first argument is not null and returns the second argument otherwise.

ToString(Object)

Returns the result of calling toString for a non-null argument and "null" for a null argument.

[Android.Runtime.Register("toString", "(Ljava/lang/Object;)Ljava/lang/String;", "")]
public static string ToString (Java.Lang.Object? o);
[<Android.Runtime.Register("toString", "(Ljava/lang/Object;)Ljava/lang/String;", "")>]
static member ToString : Java.Lang.Object -> string

Parameters

o
Object

an object

Returns

the result of calling toString for a non-null argument and "null" for a null argument

Attributes

Remarks

Returns the result of calling toString for a non-null argument and "null" for a null argument.

Java documentation for java.util.Objects.toString(java.lang.Object).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ToString(Object, String)

Returns the result of calling toString on the first argument if the first argument is not null and returns the second argument otherwise.

[Android.Runtime.Register("toString", "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/String;", "")]
public static string ToString (Java.Lang.Object? o, string nullDefault);
[<Android.Runtime.Register("toString", "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/String;", "")>]
static member ToString : Java.Lang.Object * string -> string

Parameters

o
Object

an object

nullDefault
String

string to return if the first argument is null

Returns

the result of calling toString on the first argument if it is not null and the second argument otherwise.

Attributes

Remarks

Returns the result of calling toString on the first argument if the first argument is not null and returns the second argument otherwise.

Java documentation for java.util.Objects.toString(java.lang.Object, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to