# ToArray()

> Converts a NativeSlice<T> to managed array.

## Definition

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

```csharp
public T[] ToArray()
```

### Returns

| Type              | Description                                                     |
| ----------------- | --------------------------------------------------------------- |
| [\<T>\[\]](./.md) | A managed array with a copy of the contents of the NativeSlice. |
