JniEnvironment.Strings.ToString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| ToString(JniObjectReference) |
Copies a Java string into a managed string without consuming the reference. |
| ToString(IntPtr) |
Copies a Java string handle's content into a managed string. |
| ToString(JniObjectReference, JniObjectReferenceOptions) |
Copies a Java string into managed memory and applies the requested source disposal. |
ToString(JniObjectReference)
Copies a Java string into a managed string without consuming the reference.
public static string? ToString(Java.Interop.JniObjectReference value);
static member ToString : Java.Interop.JniObjectReference -> string
Parameters
- value
- JniObjectReference
The Java string reference. This overload does not dispose it.
Returns
The copied managed string, or null if value has a zero handle.
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
ToString(IntPtr)
Copies a Java string handle's content into a managed string.
public static string? ToString(IntPtr reference);
static member ToString : nativeint -> string
Parameters
- reference
-
IntPtr
nativeint
The Java string handle. This overload does not delete the reference.
Returns
The copied managed string, or null for a zero handle.
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
ToString(JniObjectReference, JniObjectReferenceOptions)
Copies a Java string into managed memory and applies the requested source disposal.
public static string? ToString(ref Java.Interop.JniObjectReference value, Java.Interop.JniObjectReferenceOptions transfer);
static member ToString : JniObjectReference * Java.Interop.JniObjectReferenceOptions -> string
Parameters
- value
- JniObjectReference
The Java string reference to copy and optionally dispose.
- transfer
- JniObjectReferenceOptions
Reference transfer options. CopyAndDispose disposes value according to its stored reference type after character access is released; the other named options preserve it.
Returns
The copied managed string, or null if value has a zero handle.
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.