# AsReadOnlySpan()

> Exposes NativeArray<T> data as a System.ReadOnlySpan<T>.

## Definition

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

```csharp
public readonly ReadOnlySpan<T> AsReadOnlySpan()
```

### Returns

| Type                                                                             | Description                 |
| -------------------------------------------------------------------------------- | --------------------------- |
| [ReadOnlySpan\<T>](https://learn.microsoft.com/dotnet/api/system.readonlyspan-1) | A `System.ReadOnlySpan<T>`. |
