Background for Skyrim SE
Member of the DbMiscFunctions script
stringfunctionStringReplace(stringTargetStr, stringSearchStr, stringReplaceStr, intCount=0, intStartIndex=0)Global

Description

Documentation Comment

Replace instances of the SearchStr with the ReplaceStr in the TargetStr
Default count = 0 which means replace all instances. Otherwise only replace the Count number.
Example:
String MyString = "A Yes, B Yes, C Yes"
String MyStringB = StringReplace(MyString, "Yes", "No")
String MyStringC = StringReplace(MyString, "Yes", "No", 2)
MyStringB == "A No, B No, C No"
MyStringC == "A No, B No, C Yes"
Requires SKSE


Parameters

  1. stringTargetStr

  2. stringSearchStr

  3. stringReplaceStr

  4. intCount=0

  5. intStartIndex=0


Examples

Auto-Generated Example

string myString__TargetStr
string myString__SearchStr
string myString__ReplaceStr
int myInt__Count
int myInt__StartIndex

string returnedValue = DbMiscFunctions.StringReplace(myString__TargetStr, myString__SearchStr, myString__ReplaceStr, myInt__Count, myInt__StartIndex)
Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.