Share via


String.ValueOf Method

Definition

Overloads

ValueOf(Int64)

Returns the string representation of the long argument.

ValueOf(Int32)

Returns the string representation of the int argument.

ValueOf(Double)

Returns the string representation of the double argument.

ValueOf(Char[])

Returns the string representation of the char array argument.

ValueOf(Single)

Returns the string representation of the float argument.

ValueOf(Boolean)

Returns the string representation of the boolean argument.

ValueOf(Object)

Returns the string representation of the Object argument.

ValueOf(Char)

Returns the string representation of the char argument.

ValueOf(Char[], Int32, Int32)

Returns the string representation of a specific subarray of the char array argument.

ValueOf(Int64)

Returns the string representation of the long argument.

[Android.Runtime.Register("valueOf", "(J)Ljava/lang/String;", "")]
public static string ValueOf (long l);
[<Android.Runtime.Register("valueOf", "(J)Ljava/lang/String;", "")>]
static member ValueOf : int64 -> string

Parameters

l
Int64

a long.

Returns

a string representation of the long argument.

Attributes

Remarks

Returns the string representation of the long argument.

The representation is exactly the one returned by the Long.toString method of one argument.

Java documentation for java.lang.String.valueOf(long).

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

ValueOf(Int32)

Returns the string representation of the int argument.

[Android.Runtime.Register("valueOf", "(I)Ljava/lang/String;", "")]
public static string ValueOf (int i);
[<Android.Runtime.Register("valueOf", "(I)Ljava/lang/String;", "")>]
static member ValueOf : int -> string

Parameters

i
Int32

an int.

Returns

a string representation of the int argument.

Attributes

Remarks

Returns the string representation of the int argument.

The representation is exactly the one returned by the Integer.toString method of one argument.

Java documentation for java.lang.String.valueOf(int).

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

ValueOf(Double)

Returns the string representation of the double argument.

[Android.Runtime.Register("valueOf", "(D)Ljava/lang/String;", "")]
public static string ValueOf (double d);
[<Android.Runtime.Register("valueOf", "(D)Ljava/lang/String;", "")>]
static member ValueOf : double -> string

Parameters

d
Double

a double.

Returns

a string representation of the double argument.

Attributes

Remarks

Returns the string representation of the double argument.

The representation is exactly the one returned by the Double.toString method of one argument.

Java documentation for java.lang.String.valueOf(double).

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

ValueOf(Char[])

Returns the string representation of the char array argument.

[Android.Runtime.Register("valueOf", "([C)Ljava/lang/String;", "")]
public static string ValueOf (char[]? data);
[<Android.Runtime.Register("valueOf", "([C)Ljava/lang/String;", "")>]
static member ValueOf : char[] -> string

Parameters

data
Char[]

the character array.

Returns

a String that contains the characters of the character array.

Attributes

Exceptions

if data is null.

Remarks

Returns the string representation of the char array argument. The contents of the character array are copied; subsequent modification of the character array does not affect the returned string.

Java documentation for java.lang.String.valueOf(char[]).

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

ValueOf(Single)

Returns the string representation of the float argument.

[Android.Runtime.Register("valueOf", "(F)Ljava/lang/String;", "")]
public static string ValueOf (float f);
[<Android.Runtime.Register("valueOf", "(F)Ljava/lang/String;", "")>]
static member ValueOf : single -> string

Parameters

f
Single

a float.

Returns

a string representation of the float argument.

Attributes

Remarks

Returns the string representation of the float argument.

The representation is exactly the one returned by the Float.toString method of one argument.

Java documentation for java.lang.String.valueOf(float).

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

ValueOf(Boolean)

Returns the string representation of the boolean argument.

[Android.Runtime.Register("valueOf", "(Z)Ljava/lang/String;", "")]
public static string ValueOf (bool b);
[<Android.Runtime.Register("valueOf", "(Z)Ljava/lang/String;", "")>]
static member ValueOf : bool -> string

Parameters

b
Boolean

a boolean.

Returns

if the argument is true, a string equal to "true" is returned; otherwise, a string equal to "false" is returned.

Attributes

Remarks

Returns the string representation of the boolean argument.

Java documentation for java.lang.String.valueOf(boolean).

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

ValueOf(Object)

Returns the string representation of the Object argument.

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

Parameters

obj
Object

an Object.

Returns

if the argument is null, then a string equal to "null"; otherwise, the value of obj.toString() is returned.

Attributes

Remarks

Returns the string representation of the Object argument.

Java documentation for java.lang.String.valueOf(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

ValueOf(Char)

Returns the string representation of the char argument.

[Android.Runtime.Register("valueOf", "(C)Ljava/lang/String;", "")]
public static string ValueOf (char c);
[<Android.Runtime.Register("valueOf", "(C)Ljava/lang/String;", "")>]
static member ValueOf : char -> string

Parameters

c
Char

a char.

Returns

a string of length 1 containing as its single character the argument c.

Attributes

Remarks

Returns the string representation of the char argument.

Java documentation for java.lang.String.valueOf(char).

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

ValueOf(Char[], Int32, Int32)

Returns the string representation of a specific subarray of the char array argument.

[Android.Runtime.Register("valueOf", "([CII)Ljava/lang/String;", "")]
public static string ValueOf (char[]? data, int offset, int count);
[<Android.Runtime.Register("valueOf", "([CII)Ljava/lang/String;", "")>]
static member ValueOf : char[] * int * int -> string

Parameters

data
Char[]

the character array.

offset
Int32

initial offset of the subarray.

count
Int32

length of the subarray.

Returns

a String that contains the characters of the specified subarray of the character array.

Attributes

Exceptions

if length , start or start + length > data.length

if data is null.

Remarks

Returns the string representation of a specific subarray of the char array argument.

The offset argument is the index of the first character of the subarray. The count argument specifies the length of the subarray. The contents of the subarray are copied; subsequent modification of the character array does not affect the returned string.

Java documentation for java.lang.String.valueOf(char[], int, int).

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