# Substring

> Returns a substring of the current StringView, starting at index start and until the end of the StringView.

## Definition

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

## Substring(int)

Returns a substring of the current [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md), starting at index **start** and until the end of the [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md).

```csharp
public StringView Substring(int start)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The starting index.

### Returns

| Type                                                                           | Description                                                                           |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) | A new [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md). |

### Remarks

This does not create another string. The substring is only a new [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) with the same base string and its start and end indices modified. The starting index is an offset to the current [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md).

## Substring(int, int)

Returns a substring of the current [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md), starting at index **start** and with the specified length.

```csharp
public StringView Substring(int start, int length)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The starting index.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The length of the substring.

### Returns

| Type                                                                           | Description                                                                           |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) | A new [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md). |

### Remarks

This does not create another string. The substring is only a new [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md) with the same base string and its start and end indices modified. The starting index is an offset to the current [StringView](/engine/6000.7/script-reference/unityeditor/search/stringview.md).
