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

FixedStringMethods.IndexOf

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

Parameters

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

Returns

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

Description

Returns the index of the first occurrence of a single Unicode rune in this string.


Declaration

public static int IndexOf(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 first occurrence of the byte sequence in this string. Returns -1 if no occurrence is found.

Description

Returns the index of the first occurrence of a byte sequence in this string.


Declaration

public static int IndexOf(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 first index in this string to consider as the first byte of the byte sequence.
distance The last index in this string to consider as the first byte of the byte sequence.

Returns

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

Description

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


Declaration

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

Parameters

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

Returns

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

Description

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


Declaration

public static int IndexOf(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 first index in this string to consider as an occurrence of the second string.
distance The last index in this string to consider as an occurrence of the second string.

Returns

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

Description

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