# Equals

> Returns true if this string and another are equal.

## Definition

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

## Equals(NativeText)

Returns true if this string and another are equal.

```csharp
public bool Equals(NativeText other)
```

### Parameters

**** (\[NativeText]\(/engine/6000.7/script-reference/unity/collections/nativetext)): Another string to compare with.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the two strings are equal. |

### Remarks

Two strings are equal if they have equal length and all their characters match.

## Equals(ReadOnly)

Returns true if this string and another are equal.

```csharp
public bool Equals(NativeText.ReadOnly other)
```

### Parameters

**** (\[ReadOnly]\(/engine/6000.7/script-reference/unity/collections/nativetext/readonly)): Another string to compare with.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the two strings are equal. |

### Remarks

Two strings are equal if they have equal length and all their characters match.

## Equals(string)

Returns true if this string and another are equal.

```csharp
[ExcludeFromBurstCompatTesting("Takes managed string")]
public bool Equals(string other)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Another string to compare with.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the two strings are equal. |

### Remarks

Two strings are equal if they have equal length and all their characters match.

## Equals(FixedString32Bytes)

Returns true if this string and another are equal.

```csharp
public bool Equals(FixedString32Bytes other)
```

### Parameters

**** (\[FixedString32Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring32bytes)): Another string to compare with.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the two strings are equal. |

### Remarks

Two strings are equal if they have equal length and all their characters match.

## Equals(FixedString64Bytes)

Returns true if this string and another are equal.

```csharp
public bool Equals(FixedString64Bytes other)
```

### Parameters

**** (\[FixedString64Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring64bytes)): Another string to compare with.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the two strings are equal. |

### Remarks

Two strings are equal if they have equal length and all their characters match.

## Equals(FixedString128Bytes)

Returns true if this string and another are equal.

```csharp
public bool Equals(FixedString128Bytes other)
```

### Parameters

**** (\[FixedString128Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring128bytes)): Another string to compare with.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the two strings are equal. |

### Remarks

Two strings are equal if they have equal length and all their characters match.

## Equals(FixedString512Bytes)

Returns true if this string and another are equal.

```csharp
public bool Equals(FixedString512Bytes other)
```

### Parameters

**** (\[FixedString512Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring512bytes)): Another string to compare with.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the two strings are equal. |

### Remarks

Two strings are equal if they have equal length and all their characters match.

## Equals(FixedString4096Bytes)

Returns true if this string and another are equal.

```csharp
public bool Equals(FixedString4096Bytes other)
```

### Parameters

**** (\[FixedString4096Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring4096bytes)): Another string to compare with.

### Returns

| Type                                                          | Description                        |
| ------------------------------------------------------------- | ---------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the two strings are equal. |

### Remarks

Two strings are equal if they have equal length and all their characters match.

## Equals(Object)

Returns true if this string and another object are equal.

```csharp
[ExcludeFromBurstCompatTesting("Takes managed object")]
public override bool Equals(object other)
```

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): Another string to compare with.

### Returns

| Type                                                          | Description                                   |
| ------------------------------------------------------------- | --------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if this string and the object are equal. |

### Remarks

For the object to be equal, it must itself be a managed string, NativeText, or FixedString"N"Bytes.

Two strings are equal if they have equal length and all their characters match.
