# Equals

> Checks whether this identifier has the same culture code as another.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

## Equals(LocaleIdentifier)

Checks whether this identifier has the same culture code as another.

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

### Parameters

**** (\[LocaleIdentifier]\(/engine/6000.7/script-reference/unity/localization/localeidentifier)): The identifier to compare with this one.

### Returns

| Type                                                          | Description                                                                               |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if both identifiers have the same culture code, ignoring case; otherwise, `false`. |

### Remarks

Codes are compared with an ordinal, case-insensitive comparison, so "en" and "EN" are equal.

Compare two identifiers that differ only by case.

### Examples

```csharp
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class LocaleIdentifierEqualsExample
    {
        public bool Run()
        {
            var a = new LocaleIdentifier("en");
            var b = new LocaleIdentifier("EN");
            return a.Equals(b);   // True
        }
    }
}
```

## Equals(Object)

Checks whether this identifier equals another object.

```csharp
public override bool Equals(object obj)
```

### Parameters

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

### Returns

| Type                                                          | Description                                                                                     |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if `obj` is an identifier with the same culture code, ignoring case; otherwise, `false`. |

### Remarks

Returns `false` when `obj` is not a [LocaleIdentifier](/engine/6000.7/script-reference/unity/localization/localeidentifier.md). Otherwise, defers to [LocaleIdentifier.Equals](/engine/6000.7/script-reference/unity/localization/localeidentifier/equals.md) for the code comparison.

Compare against a boxed identifier.

### Examples

```csharp
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class LocaleIdentifierEqualsObjectExample
    {
        public bool Run(object other)
        {
            var identifier = new LocaleIdentifier("en");
            return identifier.Equals(other);
        }
    }
}
```
