# IndexOf

> Searches the literal text for the search char. Does not search in nested placeholders.

## Definition

* **Type:** Method
* **Namespace:** [Unity.SmartStrings.Core.Parsing](/engine/6000.7/script-reference/unity/smartstrings/core/parsing.md)
* **Assembly:** UnityEngine.SmartStringsModule

## IndexOf(char)

Searches the literal text for the search char. Does not search in nested placeholders.

```csharp
public int IndexOf(char search)
```

### Parameters

**** (\[char]\(https\://learn.microsoft.com/dotnet/api/system.char)): Character to locate.

### Returns

| Type                                                       | Description                                                                                                             |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The zero-based index of the first occurrence of the character in the literal text, or -1 if the character is not found. |

## IndexOf(char, int)

Searches the literal text for the search char. Does not search in nested placeholders.

```csharp
public int IndexOf(char search, int start)
```

### Parameters

**** (\[char]\(https\://learn.microsoft.com/dotnet/api/system.char)): Character to locate.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index to start the search from.

### Returns

| Type                                                       | Description                                                                                                             |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The zero-based index of the first occurrence of the character in the literal text, or -1 if the character is not found. |
