<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Licenses.html"> <link rel="next" href="Base64.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Tables" rel="Chapter" href="Tables.html"> <link title="Licenses" rel="Chapter" href="Licenses.html"> <link title="Utils" rel="Chapter" href="Utils.html"> <link title="Base64" rel="Chapter" href="Base64.html"> <link title="Args" rel="Chapter" href="Args.html"> <link title="Definitions" rel="Chapter" href="Definitions.html"> <link title="Icons" rel="Chapter" href="Icons.html"> <link title="Main" rel="Chapter" href="Main.html"> <link title="DefinitionLexer" rel="Chapter" href="DefinitionLexer.html"> <link title="Search_js" rel="Chapter" href="Search_js.html"> <link title="DefinitionParser" rel="Chapter" href="DefinitionParser.html"> <link title="Search" rel="Chapter" href="Search.html"> <link title="Version" rel="Chapter" href="Version.html"><link title="String functions" rel="Section" href="#6_Stringfunctions"> <link title="I/O functions" rel="Section" href="#6_IOfunctions"> <title>Utils</title> </head> <body> <div class="navbar"><a class="pre" href="Licenses.html" title="Licenses">Previous</a> <a class="up" href="index.html" title="Index">Up</a> <a class="post" href="Base64.html" title="Base64">Next</a> </div> <h1>Module <a href="type_Utils.html">Utils</a></h1> <pre><span class="keyword">module</span> Utils: <code class="code">sig</code> <a href="Utils.html">..</a> <code class="code">end</code></pre><div class="info module top"> Miscellaneous utility functions.<br> </div> <hr width="100%"> <br> <h6 id="6_Stringfunctions">String functions</h6><br> <pre><span id="VALtrim_left"><span class="keyword">val</span> trim_left</span> : <code class="type">string -> string</code></pre><div class="info "> Returns a copy of the string without leading whitespace.<br> </div> <pre><span id="VALtrim_right"><span class="keyword">val</span> trim_right</span> : <code class="type">string -> string</code></pre><div class="info "> Returns a copy of the string without trailing whitespace.<br> </div> <pre><span id="VALtrim"><span class="keyword">val</span> trim</span> : <code class="type">string -> string</code></pre><div class="info "> Returns a copy of the string without leading and trailing whitespace.<br> </div> <br> <h6 id="6_IOfunctions">I/O functions</h6><br> <pre><span id="VALread_lines"><span class="keyword">val</span> read_lines</span> : <code class="type">string -> string list</code></pre><div class="info "> <code class="code">read_lines filename</code> returns the lines from the file named <code class="code">filename</code>. <p> Raises an exception if an i/o error occurs.<br> </div> <pre><span id="VALwrite_lines"><span class="keyword">val</span> write_lines</span> : <code class="type">string -> string list -> unit</code></pre><div class="info "> <code class="code">write_lines filename lines</code> writes the strings from <code class="code">lines</code> to the file named <code class="code">filename</code>. <p> Raises an exception if an i/o error occurs.<br> </div> </body></html>