<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3ARle_Compress_String</id>
	<title>TI-BASIC:Rle Compress String - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3ARle_Compress_String"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Rle_Compress_String&amp;action=history"/>
	<updated>2026-04-17T20:20:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=TI-BASIC:Rle_Compress_String&amp;diff=1098&amp;oldid=prev</id>
		<title>Maintenance script: Initial automated import</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Rle_Compress_String&amp;diff=1098&amp;oldid=prev"/>
		<updated>2016-02-24T18:34:31Z</updated>

		<summary type="html">&lt;p&gt;Initial automated import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;:&amp;quot;_OO3_OO_O3_O_2O_2O-&amp;gt;Str1&lt;br /&gt;
 :&amp;quot;_-&amp;gt;Str2&lt;br /&gt;
 :For(F,1,length(Str1&lt;br /&gt;
 :sub(Str1,F,1-&amp;gt;Str3&lt;br /&gt;
 :If inString(&amp;quot;123456789&amp;quot;,Str3&lt;br /&gt;
 :Then&lt;br /&gt;
 :For(G,1,expr(Str3&lt;br /&gt;
 :Str2+sub(Str1,F+1,1-&amp;gt;Str2&lt;br /&gt;
 :End&lt;br /&gt;
 :Else&lt;br /&gt;
 :Str2+Str3-&amp;gt;Str2&lt;br /&gt;
 :End&lt;br /&gt;
 :End&lt;br /&gt;
&lt;br /&gt;
You can use a technique known as [wikipedia:Run-length_encoding Run-length encoding (RLE)] to compress a string. In the example above, this is done by placing a number in front of the consecutive repeated tokens. Str1 is the compressed string, and Str2 is the decompressed string. In Str2, the &amp;quot;2O&amp;quot; in Str1 becomes &amp;quot;OOO&amp;quot;, and &amp;quot;3_&amp;quot; becomes &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Related Routines =&lt;br /&gt;
&lt;br /&gt;
* [[TI-BASIC:Rle_Compress|RLE Compression]]&lt;br /&gt;
* [[TI-BASIC:Rle_Decompress|RLE Decompression]][[Category:TI-BASIC]]&lt;br /&gt;
[[Category:TIBD]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>