Method
public int IndexOf(string str, int startIndex = 0)
|
public int IndexOf(FastString str, int startIndex = 0)
|
public int IndexOf(char c, int startIndex = 0)
|
Parameters
str
|
string
|
String to find
|
startIndex
|
int
|
Index to start searching at
|
c
|
char
|
Character to find
|
Returns
int
Index of the string, or -1 if not found
DescriptionReturn first index of given string. startIndex can be specified to start search from the given index. Example FastString fstr = new FastString(256);
void Update() { fstr.Set("retroblit is retro"); Debug.Log(fstr.IndexOf("retro")); Debug.Log(fstr.IndexOf("retro"), 1); Debug.Log(fstr.IndexOf("missing"), 1); } |
See AlsoFastString.LastIndexOf |