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

FixedStringMethods.LastIndexOf

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 int LastIndexOf(ref T fs, Rune rune);

Parameters

Parameter Description
fs A string to search.
rune A single Unicode.Rune to search for within this string.

Returns

int The index of the last occurrence of the byte sequence within this string. Returns -1 if no occurrence is found.

Description

Returns the index of the last occurrence of a single Unicode rune within this string.


Declaration

public static int LastIndexOf(ref T fs, byte* bytes, int bytesLen);

Parameters

Parameter Description
fs A string to search.
bytes A byte sequence to search for within this string.
bytesLen The number of bytes in the byte sequence.

Returns

int The index of the last occurrence of the byte sequence within this string. Returns -1 if no occurrence is found.

Description

Returns the index of the last occurrence of a byte sequence within this string.


Declaration

public static int LastIndexOf(ref T fs, byte* bytes, int bytesLen, int startIndex, int distance);

Parameters

Parameter Description
fs A string to search.
bytes A byte sequence to search for within this string.
bytesLen The number of bytes in the byte sequence.
startIndex The smallest index in this string to consider as the first byte of the byte sequence.
distance The greatest index in this string to consider as the first byte of the byte sequence.

Returns

int The index of the last occurrence of the byte sequence within this string. Returns -1 if no occurrences found.

Description

Returns the index of the last occurrence of a byte sequence within a subrange of this string.


Declaration

public static int LastIndexOf(ref T fs, ref T2 other);

Parameters

Parameter Description
fs A string to search.
other A substring to search for in the this string.

Returns

int The index of the last occurrence of the substring within this string. Returns -1 if no occurrence is found.

Description

Returns the index of the last occurrence of a substring within this string.


Declaration

public static int LastIndexOf(ref T fs, ref T2 other, int startIndex, int distance);

Parameters

Parameter Description
fs A string to search.
other A substring to search for within this string.
startIndex The greatest index in this string to consider as an occurrence of the substring.
distance The smallest index in this string to consider as an occurrence of the substring.

Returns

int the index of the last occurrence of the substring within the first string. Returns -1 if no occurrence is found.

Description

Returns the index of the last occurrence of a substring within a subrange of this string.