# LastIndexOf

> Returns the index of the last occurence of another StringView within this one.

## Definition

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

## LastIndexOf(StringView, StringComparison)

Returns the index of the last occurence of another [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) within this one.

```csharp
public int LastIndexOf(StringView other, StringComparison sc = StringComparison.Ordinal)
```

### Parameters

**** (\[StringView]\(/engine/6000.7/script-reference/unityeditor/search/stringview)): A [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md).**** (\[StringComparison]\(https\://learn.microsoft.com/dotnet/api/system.stringcomparison)): A string comparision option.

### Returns

| Type                                                       | Description                                                                                                                     |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The last index where the [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) is found, otherwise -1. |

## LastIndexOf(string, StringComparison)

Returns the index of the last occurence of another [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) within this one.

```csharp
public int LastIndexOf(string other, StringComparison sc = StringComparison.Ordinal)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md).**** (\[StringComparison]\(https\://learn.microsoft.com/dotnet/api/system.stringcomparison)): A string comparision option.

### Returns

| Type                                                       | Description                                                                                                                     |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The last index where the [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) is found, otherwise -1. |

## LastIndexOf(char, StringComparison)

Returns the index of the last occurence of another [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) within this one.

```csharp
public int LastIndexOf(char other, StringComparison sc = StringComparison.Ordinal)
```

### Parameters

**** (\[char]\(https\://learn.microsoft.com/dotnet/api/system.char)): A [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md).**** (\[StringComparison]\(https\://learn.microsoft.com/dotnet/api/system.stringcomparison)): A string comparision option.

### Returns

| Type                                                       | Description                                                                                                                     |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The last index where the [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) is found, otherwise -1. |
