# ClassListContains

> Searches for a class in the class list of this element.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.6/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## ClassListContains(string)

Searches for a class in the class list of this element.

```csharp
public bool ClassListContains(string cls)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the class for the search query.

### Returns

| Type                                                          | Description                                                              |
| ------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the class is part of the list. Otherwise, returns false. |

### Remarks

This method always returns false if class name is null or empty.

## ClassListContains(UniqueStyleString)

Searches for a class in the class list of this element.

```csharp
public bool ClassListContains(UniqueStyleString cls)
```

### Parameters

**** (\[UniqueStyleString]\(/engine/6000.6/script-reference/unityengine/uielements/uniquestylestring)): The name of the class for the search query.

### Returns

| Type                                                          | Description                                                              |
| ------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the class is part of the list. Otherwise, returns false. |

### Remarks

This method always returns false if class name is null or empty.
