IndexOf
Returns the index of the first occurrence of a single Unicode rune in this string.
Read time 3 minutesLast updated 7 days ago
Definition
- Type: Method
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
IndexOf<T>(T, Rune)
Returns the index of the first occurrence of a single Unicode rune in this string.
public static int IndexOf<T>(this ref T fs, Unicode.Rune rune) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| int | The index of the first occurrence of the byte sequence in this string. Returns -1 if no occurrence is found. |
IndexOf<T>(T, byte*, int)
Returns the index of the first occurrence of a byte sequence in this string.
public static int IndexOf<T>(this ref T fs, byte* bytes, int bytesLen) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| int | The index of the first occurrence of the byte sequence in this string. Returns -1 if no occurrence is found. |
IndexOf<T>(T, byte*, int, int, int)
Returns the index of the first occurrence of a byte sequence within a subrange of this string.
public static int IndexOf<T>(this ref T fs, byte* bytes, int bytesLen, int startIndex, int distance = 2147483647) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
A byte sequence to search for within this string.
The number of bytes in the byte sequence.
The first index in this string to consider as the first byte of the byte sequence.
The last index in this string to consider as the first byte of the byte sequence.
Returns
Type | Description |
|---|---|
| int | The index of the first occurrence of the byte sequence in this string. Returns -1 if no occurrence is found. |
IndexOf<T, U>(T, T)
Returns the index of the first occurrence of a substring within this string.
public static int IndexOf<T, T2>(this ref T fs, in T2 other) where T : unmanaged, INativeList<byte>, IUTF8Bytes where T2 : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| int | The index of the first occurrence of the second string within this string. Returns -1 if no occurrence is found. |
IndexOf<T, U>(T, T, int, int)
Returns the index of the first occurrence of a substring within a subrange of this string.
public static int IndexOf<T, T2>(this ref T fs, in T2 other, int startIndex, int distance = 2147483647) where T : unmanaged, INativeList<byte>, IUTF8Bytes where T2 : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| int | The index of the first occurrence of the substring within this string. Returns -1 if no occurrence is found. |