Rle Compress String
:If inString("123456789",Str3

You can use a technique known as 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 "2O" in Str1 becomes "OOO", and "3_" becomes "".

Related Routines


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License