Language

JniEnvironment.Strings.NewString Method

Definition

Overloads

Name Description
NewString(String)

Creates a Java string from a managed string.

NewString(Char*, Int32)

Creates a Java string from a native UTF-16 buffer.

NewString(String)

Creates a Java string from a managed string.

public static Java.Interop.JniObjectReference NewString(string? value);
static member NewString : string -> Java.Interop.JniObjectReference

Parameters

value
String

The managed string to copy, or null for a null Java reference.

Returns

A new local Java string reference, or an invalid reference when value is null.

Remarks

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

NewString(Char*, Int32)

Creates a Java string from a native UTF-16 buffer.

public static Java.Interop.JniObjectReference NewString(char* unicodeChars, int length);
static member NewString : nativeptr<char> * int -> Java.Interop.JniObjectReference

Parameters

unicodeChars
Char*

A pointer to the UTF-16 code units to copy.

length
Int32

The number of UTF-16 code units to copy.

Returns

The local JNI reference returned by string creation.

Remarks

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