Method Substring
Substring<T>(ref T, int, int)
Retrieves a substring of this string. The substring starts from a specific character index, and has a specified length.
Declaration
public static T Substring<T>(this ref T str, int startIndex, int length) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
| Type | Name | Description |
|---|---|---|
| T | str | A string to get the substring from. |
| int | startIndex | Start index of substring. |
| int | length | Length of substring. |
Returns
| Type | Description |
|---|---|
| T | A new string with length equivalent to |
Type Parameters
| Name | Description |
|---|---|
| T | A string type. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown if startIndex or length parameter is negative, or if startIndex is larger than the string length. |
Substring<T>(ref T, int)
Retrieves a substring of this string. The substring starts from a specific character index and continues to the end of the string.
Declaration
public static T Substring<T>(this ref T str, int startIndex) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
| Type | Name | Description |
|---|---|---|
| T | str | A string to get the substring from. |
| int | startIndex | Start index of substring. |
Returns
| Type | Description |
|---|---|
| T | A new string that begins at |
Type Parameters
| Name | Description |
|---|---|
| T | A string type. |
Substring(ref 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.
Declaration
public static NativeText Substring(this ref NativeText str, int startIndex, int length, AllocatorManager.AllocatorHandle allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeText | str | A NativeText string to get the substring from. |
| int | startIndex | Start index of substring. |
| int | length | Length of substring. |
| AllocatorManager.AllocatorHandle | allocator | The AllocatorManager.AllocatorHandle allocator type to use. |
Returns
| Type | Description |
|---|---|
| NativeText | A |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown if startIndex or length parameter is negative, or if startIndex is larger than string length. |
Substring(ref 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.
Declaration
public static NativeText Substring(this ref NativeText str, int startIndex, AllocatorManager.AllocatorHandle allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeText | str | A NativeText string to get the substring from. |
| int | startIndex | Start index of substring. |
| AllocatorManager.AllocatorHandle | allocator | The AllocatorManager.AllocatorHandle allocator type to use. |
Returns
| Type | Description |
|---|---|
| NativeText | A NativeText string that begins at |
Substring(ref 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.
Declaration
public static NativeText Substring(this ref NativeText str, int startIndex, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeText | str | A NativeText string to get the substring from. |
| int | startIndex | Start index of substring. |
| int | length | Length of substring. |
Returns
| Type | Description |
|---|---|
| NativeText | A NativeText string that has length equivalent to |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown if startIndex or length parameter is negative, or if startIndex is larger than string length. |
Substring(ref 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.
Declaration
public static NativeText Substring(this ref NativeText str, int startIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeText | str | A NativeText to get the substring from. |
| int | startIndex | Start index of substring. |
Returns
| Type | Description |
|---|---|
| NativeText | A NativeText string that begins at |