LSL Wiki Mirror 10-5-2006: llDeleteSubString

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
string llDeleteSubString(string src, integer start, integer end)

Returns a copy of src with the indicated substring removed. The src is unaltered.

The start and end are inclusive, so 0, length - 1 would return an empty string and 0,0 would delete the first character. Using negative numbers for start and/or end causes the index to count backwards from the length of the string, so 0, -1 would delete the entire string. If start is larger than end the substring is the exclusion of the entries, so 6, 4 would delete the entire string except for the 5th character.

Compare to llGetSubString.

Example:
string test = "Example";

llSay(0, llDeleteSubString(test, 2, 5)); // outputs "Exe"


Functions / String
There are 2 comments on this page. [Display comments/form]