<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://fenixdocs.com/skins/common/feed.css?63"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Substr - Revision history</title>
		<link>http://fenixdocs.com/index.php?title=Substr&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.10.1</generator>
		<lastBuildDate>Fri, 01 May 2026 11:57:37 GMT</lastBuildDate>
		<item>
			<title>Sandman: /* Notes */</title>
			<link>http://fenixdocs.com/index.php?title=Substr&amp;diff=4351&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Notes&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 00:07, 23 February 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 20:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 20:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;== Notes ==&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;== Notes ==&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;Before [[Fenix]] [[0.92]], if the number of characters is specified as 0, it is interpreted the same as if the number of characters were not specified. Because of this, code like implementation of backspace functionality should be done a little different:&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;Before [[Fenix]] [[0.92]], if the number of characters is specified as 0, it is interpreted the same as if the number of characters were not specified&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, meaning the returned string will be all characters from '' startposition''&lt;/ins&gt;. Because of this, code like implementation of backspace functionality should be done a little different:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;if(len(str)&amp;gt;1)&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;if(len(str)&amp;gt;1)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 23 Feb 2008 00:07:35 GMT</pubDate>			<dc:creator>Sandman</dc:creator>			<comments>http://fenixdocs.com/index.php/Talk:Substr</comments>		</item>
		<item>
			<title>Sandman: /* Example */</title>
			<link>http://fenixdocs.com/index.php?title=Substr&amp;diff=3906&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Example&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 00:43, 26 November 2007&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 62:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 62:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;Used in example: [[say]](), [[key]]()&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;Used in example: [[say]](), [[key]]()&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;{{Funcbox&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;  | category = Strings&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;}}&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Mon, 26 Nov 2007 00:43:55 GMT</pubDate>			<dc:creator>Sandman</dc:creator>			<comments>http://fenixdocs.com/index.php/Talk:Substr</comments>		</item>
		<item>
			<title>Sandman: New page: Category:functions Category:strings  ==Definition== '''INT''' substr ( &lt;'''STRING''' str&gt; , &lt;'''INT''' startposition&gt; , [&lt;'''INT''' characters&gt;] )  Returns a subsection of a certai...</title>
			<link>http://fenixdocs.com/index.php?title=Substr&amp;diff=3227&amp;oldid=prev</link>
			<description>&lt;p&gt;New page: &lt;a href=&quot;/index.php/Category:Functions&quot; title=&quot;Category:Functions&quot;&gt;Category:functions&lt;/a&gt; &lt;a href=&quot;/index.php/Category:Strings&quot; title=&quot;Category:Strings&quot;&gt;Category:strings&lt;/a&gt;  ==Definition== '''INT''' substr ( &amp;lt;'''STRING''' str&amp;gt; , &amp;lt;'''INT''' startposition&amp;gt; , [&amp;lt;'''INT''' characters&amp;gt;] )  Returns a subsection of a certai...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:functions]]&lt;br /&gt;
[[Category:strings]]&lt;br /&gt;
&lt;br /&gt;
==Definition==&lt;br /&gt;
'''INT''' substr ( &amp;lt;'''STRING''' str&amp;gt; , &amp;lt;'''INT''' startposition&amp;gt; , [&amp;lt;'''INT''' characters&amp;gt;] )&lt;br /&gt;
&lt;br /&gt;
Returns a subsection of a certain string.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| &lt;br /&gt;
| '''STRING''' str || - The string of which a subsection will be returned.&lt;br /&gt;
|-&lt;br /&gt;
| '''INT''' startposition || - The position of the first character to be in the subsection.&lt;br /&gt;
|-&lt;br /&gt;
| ['''INT''' characters] || - The number of characters the subsection will hold. Negative values are special; see [[#Notes|Notes]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
'''STRING''' : The subsection.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
Before [[Fenix]] [[0.92]], if the number of characters is specified as 0, it is interpreted the same as if the number of characters were not specified. Because of this, code like implementation of backspace functionality should be done a little different:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if(len(str)&amp;gt;1)&lt;br /&gt;
    str = substr(str,0,len(str)-1);&lt;br /&gt;
else&lt;br /&gt;
    str = &amp;quot;&amp;quot;;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Used in code: [[len]]()&lt;br /&gt;
&lt;br /&gt;
If the number of characters is a negative value, the following applies: the start of the subsection will be ''startposition''; the end of the subsection will be the length of the string minus the absolute value of ''characters''.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Private                             &lt;br /&gt;
    String str = &amp;quot;This is my string.&amp;quot;;&lt;br /&gt;
Begin&lt;br /&gt;
&lt;br /&gt;
    // No specified number of characters&lt;br /&gt;
    say( substr(str,2)     + &amp;quot;&amp;lt;&amp;quot; ); // &amp;quot;is is my string.&amp;quot;&lt;br /&gt;
    say( substr(str,-7)    + &amp;quot;&amp;lt;&amp;quot; ); // &amp;quot;string.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    // Specified number of characters&lt;br /&gt;
    say( substr(str,5,2)   + &amp;quot;&amp;lt;&amp;quot; ); // &amp;quot;is&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    // Number of characters greater than length of string&lt;br /&gt;
    say( substr(str,2,50)  + &amp;quot;&amp;lt;&amp;quot; ); // &amp;quot;is my string.&amp;quot;&lt;br /&gt;
    say( substr(str,-7,50) + &amp;quot;&amp;lt;&amp;quot; ); // &amp;quot;is&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    // Negative number of characters&lt;br /&gt;
    say( substr(str,5,-5)  + &amp;quot;&amp;lt;&amp;quot; ); // &amp;quot;is my st&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    // Special case&lt;br /&gt;
    say( substr(str,0,0)   + &amp;quot;&amp;lt;&amp;quot; ); // &amp;quot;&amp;quot;, but pre 0.92: &amp;quot;This is my string.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    Repeat&lt;br /&gt;
        frame;&lt;br /&gt;
    Until(key(_ESC))&lt;br /&gt;
&lt;br /&gt;
End&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Used in example: [[say]](), [[key]]()&lt;/div&gt;</description>
			<pubDate>Fri, 31 Aug 2007 18:14:54 GMT</pubDate>			<dc:creator>Sandman</dc:creator>			<comments>http://fenixdocs.com/index.php/Talk:Substr</comments>		</item>
	</channel>
</rss>