Substring
Retrieves a substring of this string. The substring starts from a specific character index, and has a specified length.
Read time 3 minutesLast updated 6 days ago
Definition
- Type: Method
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
Substring<T>(T, int, int)
Retrieves a substring of this string. The substring starts from a specific character index, and has a specified length.
public static T Substring<T>(this ref T str, int startIndex, int length) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| T | A new string with length equivalent to |
Substring<T>(T, int)
Retrieves a substring of this string. The substring starts from a specific character index and continues to the end of the string.
public static T Substring<T>(this ref T str, int startIndex) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| T | A new string that begins at |
Substring(NativeText, int, int, AllocatorHandle)
Retrieves a substring from this string. The substring starts from a specific character index, and has a specified length. Allocates memory to the new substring with the allocator specified.
public static NativeText Substring(this ref NativeText str, int startIndex, int length, AllocatorManager.AllocatorHandle allocator)
Parameters
A NativeText string to get the substring from.
Start index of substring.
Length of substring.
The AllocatorManager.AllocatorHandle allocator type to use.
Returns
Type | Description |
|---|---|
| NativeText | A |
Substring(NativeText, int, AllocatorHandle)
Retrieves a substring of this string. The substring starts from a specific character index and continues to the end of the string. Allocates memory to the new substring with the allocator specified.
public static NativeText Substring(this ref NativeText str, int startIndex, AllocatorManager.AllocatorHandle allocator)
Parameters
A NativeText string to get the substring from.
Start index of substring.
The AllocatorManager.AllocatorHandle allocator type to use.
Returns
Type | Description |
|---|---|
| NativeText | A NativeText string that begins at |
Substring(NativeText, int, int)
Retrieves a substring of this string. The substring starts from a specific character index, and has a specified length. The new substring has the same allocator as the string.
public static NativeText Substring(this ref NativeText str, int startIndex, int length)
Parameters
Returns
Type | Description |
|---|---|
| NativeText | A NativeText string that has length equivalent to |
Substring(NativeText, int)
Retrieves a substring of this string. The substring starts from a specific character index and continues to the end of the string. The new substring has the same allocator as the string.
public static NativeText Substring(this ref NativeText str, int startIndex)
Parameters
Returns
Type | Description |
|---|---|
| NativeText | A NativeText string that begins at |