Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

FixedStringMethods.Substring

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static T Substring(ref T str, int startIndex, int length);

Parameters

Parameter Description
str A string to get the substring from.
startIndex Start index of substring.
length Length of substring.

Returns

T A new string with length equivalent to length that begins at startIndex.

Description

Retrieves a substring of this string. The substring starts from a specific character index, and has a specified length.


Declaration

public static T Substring(ref T str, int startIndex);

Parameters

Parameter Description
str A string to get the substring from.
startIndex Start index of substring.

Returns

T A new string that begins at startIndex.

Description

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 NativeText Substring(ref NativeText str, int startIndex, int length, AllocatorHandle allocator);

Parameters

Parameter Description
str A NativeText string to get the substring from.
startIndex Start index of substring.
length Length of substring.
allocator The AllocatorHandle allocator type to use.

Returns

NativeText A NativeText string with a length equivalent to length that starts at startIndex and an allocator type of allocator.

Description

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(ref NativeText str, int startIndex, AllocatorHandle allocator);

Parameters

Parameter Description
str A NativeText string to get the substring from.
startIndex Start index of substring.
allocator The AllocatorHandle allocator type to use.

Returns

NativeText A NativeText string that begins at startIndex and has an allocator of type allocator.

Description

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(ref NativeText str, int startIndex, int length);

Parameters

Parameter Description
str A NativeText string to get the substring from.
startIndex Start index of substring.
length Length of substring.

Returns

NativeText A NativeText string that has length equivalent to length and begins at startIndex.

Description

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(ref NativeText str, int startIndex);

Parameters

Parameter Description
str A NativeText to get the substring from.
startIndex Start index of substring.

Returns

NativeText A NativeText string that begins at startIndex.

Description

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.