# TryResize(int, NativeArrayOptions)

> Attempt to set the length in bytes of this string.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public bool TryResize(int newLength, NativeArrayOptions clearOptions = NativeArrayOptions.ClearMemory)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The new length in bytes of the string.**** (\[NativeArrayOptions]\(/engine/6000.7/script-reference/unity/collections/nativearrayoptions)): Whether any bytes added should be zeroed out.

### Returns

| Type                                                          | Description  |
| ------------------------------------------------------------- | ------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Always true. |
