# GetUnsafePtr()

> Returns a pointer to this string's character buffer.

## Definition

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

```csharp
public byte* GetUnsafePtr()
```

### Returns

| Type                                                         | Description                                  |
| ------------------------------------------------------------ | -------------------------------------------- |
| [byte\*](https://learn.microsoft.com/dotnet/api/system.byte) | A pointer to this string's character buffer. |

### Remarks

The pointer is made invalid by operations that reallocate the character buffer, such as setting [NativeText.ReadOnly.Capacity](/engine/6000.7/script-reference/unity/collections/nativetext/readonly/capacity.md).
