Skip to content

llReplaceSubString

function ll.ReplaceSubString(InitialString: string, SubString: string, NewSubString: string, Count: number): string

Searches InitialString and replaces instances of SubString with NewSubString. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left.

Parameters
InitialString (string)
The original string in which to hunt for substring matches.
SubString (string)
The original substring to find.
NewSubString (string)
The new substring used to replace.
Count (number)
The max number of replacements to make. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left.

Add example usage here showing SLua/Luau syntax with ll.ReplaceSubString().

Add additional notes, caveats, or tips specific to using this function in SLua/Luau.