# CompareTo

> Check if two SearchItems have the same ID.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Search](/engine/6000.0/script-reference/unityeditor/search.md)
* **Assembly:** UnityEditor

## CompareTo(SearchItem)

Check if two SearchItems have the same ID.

```csharp
public int CompareTo(SearchItem other)
```

### Parameters

**** (\[SearchItem]\(/engine/6000.0/script-reference/unityeditor/search/searchitem)): Another SearchItem to compare.

### Returns

| Type                                                       | Description                                |
| ---------------------------------------------------------- | ------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns 0 if SearchItems have the same ID. |

## CompareTo(Object)

Check if two SearchItems have the same ID.

```csharp
public int CompareTo(object other)
```

### Parameters

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

### Returns

| Type                                                       | Description                                |
| ---------------------------------------------------------- | ------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns 0 if SearchItems have the same ID. |
