# AsReadOnly()

> Returns a readonly version of this NativeText instance.

## Definition

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

```csharp
public NativeText.ReadOnly AsReadOnly()
```

### Returns

| Type                                                                                 | Description                 |
| ------------------------------------------------------------------------------------ | --------------------------- |
| [ReadOnly](/engine/6000.7/script-reference/unity/collections/nativetext/readonly.md) | ReadOnly instance for this. |

### Remarks

ReadOnly containers point to the same underlying data as the NativeText it is made from. Note while ReadOnly contains methods that would write to the string data these methods will perform no writes and/or throw a NotSupportedException.
