# IndexOf(string)

> Finds the position of a channel in the set by name.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public int IndexOf(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Name of the channel.

### Returns

| Type                                                       | Description                                                                        |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The position of the channel. If the set has no channel with that name, returns -1. |

### Remarks

This method compares the name with each channel in turn. To access a channel often, look up its position once and then use the position with `this[int]`.
