# NewString

> Constructs a new \<tt\>java.lang.String\</tt\> object from an array of Unicode characters.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AndroidJNIModule

## NewString(string)

Constructs a new \\\<tt\\>java.lang.String\\\</tt\\> object from an array of Unicode characters.

```csharp
public static nint NewString(string chars)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### Remarks

Additional Resources: [Java Native Interface Specification (Oracle)](http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html)

## NewString(char\[])

Constructs a new \\\<tt\\>java.lang.String\\\</tt\\> object from an array of Unicode characters.

```csharp
public static nint NewString(char[] chars)
```

### Parameters

**** (\[char\[]]\(https\://learn.microsoft.com/dotnet/api/system.char)):&#x20;

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### Remarks

Additional Resources: [Java Native Interface Specification (Oracle)](http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html)
