- Found in:
- SKSE
Description
Wiki Description
Returns a portion of the string starting at given index, optionally with specified amount of characters. (This function requires SKSE)
Documentation Comment
returns a substring of the specified string starting at startIndex and going for len characters
or until the end of the string. Default len of 0 means for the entire string
Caveats
CK Wiki - Notes
Invalid len value will work as if 0 was given.
This function is case-insensitive (like all SKSE string functions right now).
Parameters
strings
CK Wiki Description
The string from which to retrieve the substring.
intstartIndex
CK Wiki Description
Starting character position of a substring.
intlen=0
CK Wiki Description
An optional length of the substring. Default of 0 means for the entire string.
- Default:0
Examples
Import StringUtil
string ss = "Sample string"
string s1 = Substring(ss, 5)
;"e string"
string s2 = Substring(ss, 2, 4)
;"mple"
string s3 = Substring(ss, 20)
;none
string s4 = Substring(ss, 0, -1)
;"sample string"Auto-Generated Example
string myString__s
int myInt__startIndex
int myInt__len
string returnedValue = StringUtil.Substring(myString__s, myInt__startIndex, myInt__len)Related Pages
- StringUtil
- StringUtil.Find(...)
