- Found in:
- SKSE
Description
Wiki Description
Returns the index of the first occurence of specified phrase inside given string, optionally starting on selected position. (This function requires SKSE)
Documentation Comment
returns the index of the first character of toFind inside string s
returns -1 if toFind is not part of the string or if startIndex is invalid
Caveats
CK Wiki - Notes
This function is case-insensitive (like all SKSE string functions right now).
Parameters
strings
CK Wiki Description
The string in which to search.
stringtoFind
CK Wiki Description
The string to look for.
intstartIndex=0
CK Wiki Description
An optional index at which the function should start looking.
- Default:0
Examples
; looking for some words
String myString = "Apple Banana"
int index1 = StringUtil.Find(myString, "Banana")
; index1 = 6
int index2 = StringUtil.Find(myString, "e", 5)
; index2 = -1
int index3 = StringUtil.Find(myString, "Apple", 22)
; index3 = -1Auto-Generated Example
string myString__s
string myString__toFind
int myInt__startIndex
int returnedValue = StringUtil.Find(myString__s, myString__toFind, myInt__startIndex)