# Find

> Finds the first length-"N" contiguous sequence of 0 bits in this bit array.

## Definition

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

## Find(int, int)

Finds the first length-"N" contiguous sequence of 0 bits in this bit array.

```csharp
public readonly int Find(int pos, int numBits)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index at which to start searching.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of contiguous 0 bits to look for.

### Returns

| Type                                                       | Description                                                                                                                                  |
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The index in this array where the sequence is found. The index will be greater than or equal to `pos`. Returns -1 if no occurrence is found. |

## Find(int, int, int)

Finds the first length-"N" contiguous sequence of 0 bits in this bit array. Searches only a subsection.

```csharp
public readonly int Find(int pos, int count, int numBits)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index at which to start searching.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of bits to search.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of contiguous 0 bits to look for.

### Returns

| Type                                                       | Description                                                                                                                                                              |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The index in this array where the sequence is found. The index will be greater than or equal to `pos` but less than `pos + count`. Returns -1 if no occurrence is found. |
