Android Guides | Samples

Java.Lang.String Constructor

Converts the byte array to a string using the named charset.

Syntax

[Android.Runtime.Register(".ctor", "([BLjava/lang/String;)V", "")]
public String (Byte[] data, String encoding)

Parameters

data
charsetName

Exceptions

TypeReason
NullPointerExceptionif data == null.
UnsupportedEncodingExceptionif charsetName is not supported.

Remarks

Converts the byte array to a string using the named charset.

The behavior when the bytes cannot be decoded by the named charset is unspecified. Use CharsetDecoder for more control.

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1