# StartsWith

> Returns true if a given character occurs at the beginning of this string.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

## StartsWith\<T>(T, Rune)

Returns true if a given character occurs at the beginning of this string.

```csharp
public static bool StartsWith<T>(this ref T fs, Unicode.Rune rune) where T : unmanaged, INativeList<byte>, IUTF8Bytes
```

### Parameters

**** (T): A string to search.**** (\[Rune]\(/engine/6000.7/script-reference/unity/collections/unicode/rune)): A character to search for within this string.

### Returns

| Type                                                          | Description                                                   |
| ------------------------------------------------------------- | ------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the character occurs at the beginning of this string. |

## StartsWith\<T, U>(T, T)

Returns true if a given substring occurs at the beginning of this string.

```csharp
public static bool StartsWith<T, U>(this ref T fs, in U other) where T : unmanaged, INativeList<byte>, IUTF8Bytes where U : unmanaged, INativeList<byte>, IUTF8Bytes
```

### Parameters

**** (T): A string to search.**** (T): A substring to search for within this string.

### Returns

| Type                                                          | Description                                                   |
| ------------------------------------------------------------- | ------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the substring occurs at the beginning of this string. |
