<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Reference</title> <link rel="stylesheet" href="../luadoc.css" type="text/css" /> <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> </head> <body> <div id="container"> <div id="product"> <div id="product_logo"></div> <div id="product_name"><big><b></b></big></div> <div id="product_description"></div> </div> <!-- id="product" --> <div id="main"> <div id="navigation"> <h1>LuaDoc</h1> <ul> <li><a href="../index.html">Index</a></li> </ul> <!-- Module list --> <h1>Modules</h1> <ul> <li> <a href="../modules/CharacterManager.html">CharacterManager</a> </li> <li> <a href="../modules/Direction.html">Direction</a> </li> <li> <a href="../modules/Game.html">Game</a> </li> <li> <a href="../modules/GameState.html">GameState</a> </li> <li> <a href="../modules/MessageMode.html">MessageMode</a> </li> <li> <a href="../modules/Nanny.html">Nanny</a> </li> <li> <a href="../modules/PlayerState.html">PlayerState</a> </li> <li> <a href="../modules/Telnet.html">Telnet</a> </li> <li> <a href="../modules/config.html">config</a> </li> <li><strong>ext.string</strong></li> <li> <a href="../modules/ext.table.html">ext.table</a> </li> <li> <a href="../modules/main.html">main</a> </li> <li> <a href="../modules/obj.Client.html">obj.Client</a> </li> <li> <a href="../modules/obj.Cloneable.html">obj.Cloneable</a> </li> <li> <a href="../modules/obj.Command.html">obj.Command</a> </li> <li> <a href="../modules/obj.CommandParser.html">obj.CommandParser</a> </li> <li> <a href="../modules/obj.Event.html">obj.Event</a> </li> <li> <a href="../modules/obj.Map.html">obj.Map</a> </li> <li> <a href="../modules/obj.MapObject.html">obj.MapObject</a> </li> <li> <a href="../modules/obj.MapTile.html">obj.MapTile</a> </li> <li> <a href="../modules/obj.Mob.html">obj.Mob</a> </li> <li> <a href="../modules/obj.Player.html">obj.Player</a> </li> <li> <a href="../modules/obj.Scheduler.html">obj.Scheduler</a> </li> <li> <a href="../modules/obj.Server.html">obj.Server</a> </li> </ul> <!-- File list --> </div><!-- id="navigation" --> <div id="content"> <h1>Module <code>ext.string</code></h1> <p>Extension of the string library.</p> <p><b>Author:</b> <table class="authors_list"> <tr><td class="name">milkmanjack</td></tr> </table> </p> <h2>Functions</h2> <table class="function_list"> <tr> <td class="name" nowrap><a href="#string.getWord">string.getWord</a> (s)</td> <td class="summary">Gets the next word in the given string.<br/> A word is defined as the first series of unbroken alphanumeric characters.</td> </tr> <tr> <td class="name" nowrap><a href="#string.getWords">string.getWords</a> (s)</td> <td class="summary">Returns an iterator that iterates over the words within the given string.</td> </tr> <tr> <td class="name" nowrap><a href="#string.truncate">string.truncate</a> (s)</td> <td class="summary">Remove whitespace from the front and back of a string.</td> </tr> </table> <br/> <br/> <h2><a name="functions"></a>Functions</h2> <dl class="function"> <dt><a name="string.getWord"></a><strong>string.getWord</strong> (s)</dt> <dd> Gets the next word in the given string.<br/> A word is defined as the first series of unbroken alphanumeric characters. Special delimiters can be defined for the word. For example, if the next word starts with a single or double quote (', "), it will end with a single or double quote, respectively. If neither are found after the first, then it will merely return everything.<br/> Also returns the remainder of the given string, if anything remains. The remainder of the string has its whitespace truncated via string.truncate(). <h3>Parameters:</h3> <ul> <li> <code><em>s</em></code>: String to get the next word from. </li> </ul> <h3>Return values:</h3> <ol> <li>The word.</li> <li>The remainder of the string, or nil.</li> </ol> </dd> <dt><a name="string.getWords"></a><strong>string.getWords</strong> (s)</dt> <dd> Returns an iterator that iterates over the words within the given string. <h3>Parameters:</h3> <ul> <li> <code><em>s</em></code>: String to iterate over. </li> </ul> <h3>Return value:</h3> <ul>Word iterator for the given string.</ul> </dd> <dt><a name="string.truncate"></a><strong>string.truncate</strong> (s)</dt> <dd> Remove whitespace from the front and back of a string. <h3>Parameters:</h3> <ul> <li> <code><em>s</em></code>: String to be truncated. </li> </ul> <h3>Return value:</h3> <ul>Truncated version of the string.</ul> </dd> </dl> </div> <!-- id="content" --> </div> <!-- id="main" --> <div id="about"> <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> </html>