<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlDeleteSubString</id>
	<title>LlDeleteSubString - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlDeleteSubString"/>
	<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlDeleteSubString&amp;action=history"/>
	<updated>2026-10-25T11:08:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>http://wiki.osgrid.org/index.php?title=LlDeleteSubString&amp;diff=83&amp;oldid=prev</id>
		<title>Osgridadmin: /* Function: string llDeleteSubString( string src, integer start, integer end ); */</title>
		<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlDeleteSubString&amp;diff=83&amp;oldid=prev"/>
		<updated>2017-12-30T16:34:52Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Function: string llDeleteSubString( string src, integer start, integer end );&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Function: string llDeleteSubString( string src, integer start, integer end );==&lt;br /&gt;
Returns a string that is the result of removing characters from src from start to end.&amp;lt;br&amp;gt;&lt;br /&gt;
• string 	src 		&amp;lt;br&amp;gt;	&lt;br /&gt;
• integer 	start 	– 	start index 	&amp;lt;br&amp;gt;&lt;br /&gt;
• integer 	end 	– 	end index 	&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
start &amp;amp; end support negative indexes.&amp;lt;br&amp;gt;&lt;br /&gt;
Characters at positions start and end are removed.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Specification&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;.5&amp;quot; style=&amp;quot;text-align:left&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;black&amp;quot; | &amp;lt;span style=&amp;quot;color:#CC6633&amp;quot;&amp;gt;Index  !! bgcolor=&amp;quot;black&amp;quot; | &amp;lt;span style=&amp;quot;color:#CC6633&amp;quot;&amp;gt;Positive !! bgcolor=&amp;quot;black&amp;quot; | &amp;lt;span style=&amp;quot;color:#CC6633&amp;quot;&amp;gt;Negative &lt;br /&gt;
|-&lt;br /&gt;
| first || 0 || -length &lt;br /&gt;
|-&lt;br /&gt;
| last || Length - 1 || -1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Mentally first translate any negative indexes into positive indexes&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
• If start &amp;lt;= end then the range operated on starts at start and ends at end. [start, end]&amp;lt;br&amp;gt;&lt;br /&gt;
• If start &amp;gt; end then the range operated on starts at 0 and goes to end and then starts again at start and goes to -1. [0, end] + [start, -1] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Positive indexes past the length (after the last index), or negative indexes past the beginning (before the first index) are valid. The effects are predictable, the entries are treated as if they were there but were removed just before output.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
See negative indexes for more information.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Examples&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string ex = &amp;quot;abcdefghi&amp;quot;;&lt;br /&gt;
        llDeleteSubString(ex, 4, 7); //Incorrect!&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string ex = &amp;quot;abcdefghi&amp;quot;;&lt;br /&gt;
        ex = llDeleteSubString(ex, 4, 7); //Correct&lt;br /&gt;
        llSay(0, ex); //Would say &amp;quot;abcdi&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
//-- special case&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string ex = &amp;quot;abcdefghi&amp;quot;;&lt;br /&gt;
        llSay( 0, llDeleteSubString(ex, 4, 7) ); //Would say &amp;quot;abcdi&amp;quot;&lt;br /&gt;
        //-- acceptable if you do NOT want to change the contents of &amp;#039;ex&amp;#039;, only the output&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notes&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
Indexes start at zero, the index of the first character is zero. Using 0,0 as start and end positions would delete the first character only. Negative indexes count from the far end of the string towards the beginning, so -1 is short form for the last character in a string. Positive and negative indexes can be mixed so using 0, -1 as start and end positions would delete the entire string.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To ascertain how long a string is, use llStringLength.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Granted, wondering how to use this can be bewildering at times: with random text strings being handled by your script, you may wonder how you can know what positions you should be starting and ending the deletion at. llSubStringIndex is the preferred method of finding a string in a string but it can be a rather involved process. If the user just wants to remove all occurrences of a string from a string they may wish to consider simply using Strife Onizuka&amp;#039;s str_replace&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
See Also &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Functions&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llGetSubString]] 	&amp;lt;br&amp;gt;		&lt;br /&gt;
•  	[[llInsertString]] 	&amp;lt;br&amp;gt;		&lt;br /&gt;
•  	[[llDeleteSubList]] 	&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Osgridadmin</name></author>
	</entry>
</feed>