# EndsWith

> Checks if the StringView ends with the character c.

## Definition

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

## EndsWith(char, StringComparison)

Checks if the [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) ends with the character **c**.

```csharp
public bool EndsWith(char c, StringComparison sc = StringComparison.Ordinal)
```

### Parameters

**** (\[char]\(https\://learn.microsoft.com/dotnet/api/system.char)): A character.**** (\[StringComparison]\(https\://learn.microsoft.com/dotnet/api/system.stringcomparison)): A string comparison option.

### Returns

| Type                                                          | Description                                                                                                                  |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) ends with **c**, otherwise false. |

## EndsWith(string, StringComparison)

Checks if the [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) ends with the string **v**.

```csharp
public bool EndsWith(string v, StringComparison sc = StringComparison.Ordinal)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A string.**** (\[StringComparison]\(https\://learn.microsoft.com/dotnet/api/system.stringcomparison)): A string comparison option.

### Returns

| Type                                                          | Description                                                                                                                  |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) ends with **v**, otherwise false. |
