# StartsWith

> Checks if the StringView starts with the character c.

## Definition

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

## StartsWith(char, StringComparison)

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

```csharp
public bool StartsWith(char c, StringComparison stringComparison = 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.5/script-reference/unityeditor/search/stringview.md) starts with **c**, otherwise false. |

## StartsWith(string, StringComparison)

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

```csharp
public bool StartsWith(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.5/script-reference/unityeditor/search/stringview.md) starts with **v**, otherwise false. |
