<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.kolmafia.us/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=69.234.105.232</id>
	<title>Kolmafia - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kolmafia.us/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=69.234.105.232"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Special:Contributions/69.234.105.232"/>
	<updated>2026-04-25T10:40:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=String_Handling_Routines&amp;diff=1472</id>
		<title>String Handling Routines</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=String_Handling_Routines&amp;diff=1472"/>
		<updated>2009-11-08T04:13:50Z</updated>

		<summary type="html">&lt;p&gt;69.234.105.232: least useful bot ever.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Part  8 - String Handling Routines ==&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Under Construction&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;void print( string helloworld )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Prints the given string to the graphical CLI window and to the status line of the main Adventuring window.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string [[visit_url alpha|visit_url( string url )]]&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Accesses the specified URL, manages any applicable redirects (including if the page offered a choice adventure), and returns the HTML of the final response page.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string location_to_url( location place )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the URL that would need to be accessed to visit the specified location.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean contains_text( string source, string query )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Reveals if the query string is a substring of the source string.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int extract_meat( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the amount of meat contained in a string passed to it in integer format. For use in k-mail parsing. *Not for use on pending trades.*&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int [item] extract_items( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
takes the text you have provided and parses it for any items that KoLmafia would have found normally.  This means you have access to the built-in pluralization handler as well as the ability to NOT have to lookup description IDs or whatever other loops you had to use to access that information. For use in k-mail parsing. *Not for use on pending trades.*&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int length( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the length of the given string.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int index_of( string source, string search )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the first index of a given substring in a string.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;int index_of( string source, string search, int start )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the next index of a given substring in a string starting from the given position.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;int last_index_of( string source, string search )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the last index of a given substring in a string.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string substring( string source, int startfrom )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the substring of the given string starting from the given character position in the string, and ending at the last character.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string substring( string source, int start, int end )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the given string starting from the character position indicated by start in the string, and ending at the character position indicated by end.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string replace_string( string source, string search, string replace )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
searches the source string for the search string and replaces all instances with the replace string&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string url_encode( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string url_decode( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Converts a string text into a formatted string for using with raw URLs or from a formatted string back into “normal” text.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string [int] split_string( string source )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns a map of strings which is the passed string split into individual lines. Originally implemented for use when parsing session logs, but may see more uses in the future.&lt;br /&gt;
http://kolmafia.us/showthread.php?t=573 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string [int] split_string( string source, string regex )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string [int,int] group_string( string source, string regex )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
see this post located on the script repository for more information:  http://kolmafia.us/showthread.php?t=318 &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;string [int] session_logs( string player, int day_count )&amp;lt;/strong&amp;gt;&lt;br /&gt;
Gives access to the session logs saved by kolmafia. More details will be added when this function&#039;s own page is written. For now, more extensive details can be found here: http://kolmafia.us/showthread.php?t=573&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;buffer append( buffer source, string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the source buffer with the string added on at the end.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;buffer append_tail( matcher regex, buffer source )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This function appends the text returned by a matcher to the end of the buffer text.&lt;/div&gt;</summary>
		<author><name>69.234.105.232</name></author>
	</entry>
</feed>