# Contains<T>()

> Checks whether a metadata item of the given type is present.

## Definition

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

```csharp
public bool Contains<T>() where T : class, IMetadata
```

### Returns

| Type                                                          | Description                                                           |
| ------------------------------------------------------------- | --------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if at least one item is assignable to `T`; otherwise, `false`. |

### Remarks

Equivalent to testing whether [MetadataCollection.GetMetadata](/engine/6000.7/script-reference/unity/localization/metadatacollection/getmetadata.md) returns a non-null value.

Check whether a collection already has a comment.

### Examples

```csharp
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class MetadataCollectionContainsExample
    {
        public bool Run(MetadataCollection metadata) => metadata.Contains<Comment>();
    }
}
```
