# NativeText

> Initializes and returns an instance of NativeText with the characters copied from another string.

## Definition

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

## NativeText(string, Allocator)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
[ExcludeFromBurstCompatTesting("Takes managed string")]
public NativeText(string source, Allocator allocator)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A string to copy characters from.**** (\[Allocator]\(/engine/6000.7/script-reference/unity/collections/allocator)): The allocator to use.

## NativeText(string, AllocatorHandle)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
[ExcludeFromBurstCompatTesting("Takes managed string")]
public NativeText(string source, AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A string to copy characters from.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

## NativeText(int, Allocator)

Initializes and returns an instance of NativeText.

```csharp
public NativeText(int capacity, Allocator allocator)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The initial capacity in bytes.**** (\[Allocator]\(/engine/6000.7/script-reference/unity/collections/allocator)): The allocator to use.

## NativeText(int, AllocatorHandle)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(int capacity, AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

## NativeText(Allocator)

Initializes and returns an instance of NativeText with an initial capacity of 512 bytes.

```csharp
public NativeText(Allocator allocator)
```

### Parameters

**** (\[Allocator]\(/engine/6000.7/script-reference/unity/collections/allocator)): The allocator to use.

## NativeText(AllocatorHandle)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

## NativeText(FixedString32Bytes, AllocatorHandle)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString32Bytes source, AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[FixedString32Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring32bytes)): A string to copy characters from.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

## NativeText(FixedString32Bytes, Allocator)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString32Bytes source, Allocator allocator)
```

### Parameters

**** (\[FixedString32Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring32bytes)): A string to copy characters from.**** (\[Allocator]\(/engine/6000.7/script-reference/unity/collections/allocator)): The allocator to use.

## NativeText(FixedString64Bytes, AllocatorHandle)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString64Bytes source, AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[FixedString64Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring64bytes)): A string to copy characters from.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

## NativeText(FixedString64Bytes, Allocator)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString64Bytes source, Allocator allocator)
```

### Parameters

**** (\[FixedString64Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring64bytes)): A string to copy characters from.**** (\[Allocator]\(/engine/6000.7/script-reference/unity/collections/allocator)): The allocator to use.

## NativeText(FixedString128Bytes, AllocatorHandle)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString128Bytes source, AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[FixedString128Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring128bytes)): A string to copy characters from.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

## NativeText(FixedString128Bytes, Allocator)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString128Bytes source, Allocator allocator)
```

### Parameters

**** (\[FixedString128Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring128bytes)): A string to copy characters from.**** (\[Allocator]\(/engine/6000.7/script-reference/unity/collections/allocator)): The allocator to use.

## NativeText(FixedString512Bytes, AllocatorHandle)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString512Bytes source, AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[FixedString512Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring512bytes)): A string to copy characters from.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

## NativeText(FixedString512Bytes, Allocator)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString512Bytes source, Allocator allocator)
```

### Parameters

**** (\[FixedString512Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring512bytes)): A string to copy characters from.**** (\[Allocator]\(/engine/6000.7/script-reference/unity/collections/allocator)): The allocator to use.

## NativeText(FixedString4096Bytes, AllocatorHandle)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString4096Bytes source, AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[FixedString4096Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring4096bytes)): A string to copy characters from.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

## NativeText(FixedString4096Bytes, Allocator)

Initializes and returns an instance of NativeText with the characters copied from another string.

```csharp
public NativeText(in FixedString4096Bytes source, Allocator allocator)
```

### Parameters

**** (\[FixedString4096Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring4096bytes)): A string to copy characters from.**** (\[Allocator]\(/engine/6000.7/script-reference/unity/collections/allocator)): The allocator to use.
