Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > bbe04b8395a5a03f2446c6fb72b617f0 > files > 58

ocaml-extlib-1.7.5-3.mga7.armv7hl.rpm

<!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">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="Start" href="index.html">
<link rel="previous" href="ExtLib.List.html">
<link rel="next" href="ExtLib.Hashtbl.html">
<link rel="Up" href="ExtLib.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Base64" rel="Chapter" href="Base64.html">
<link title="BitSet" rel="Chapter" href="BitSet.html">
<link title="Dllist" rel="Chapter" href="Dllist.html">
<link title="DynArray" rel="Chapter" href="DynArray.html">
<link title="Enum" rel="Chapter" href="Enum.html">
<link title="ExtArray" rel="Chapter" href="ExtArray.html">
<link title="ExtBuffer" rel="Chapter" href="ExtBuffer.html">
<link title="ExtBytes" rel="Chapter" href="ExtBytes.html">
<link title="ExtHashtbl" rel="Chapter" href="ExtHashtbl.html">
<link title="ExtLib" rel="Chapter" href="ExtLib.html">
<link title="ExtList" rel="Chapter" href="ExtList.html">
<link title="ExtString" rel="Chapter" href="ExtString.html">
<link title="Global" rel="Chapter" href="Global.html">
<link title="IO" rel="Chapter" href="IO.html">
<link title="OptParse" rel="Chapter" href="OptParse.html">
<link title="Option" rel="Chapter" href="Option.html">
<link title="PMap" rel="Chapter" href="PMap.html">
<link title="RefList" rel="Chapter" href="RefList.html">
<link title="Std" rel="Chapter" href="Std.html">
<link title="UChar" rel="Chapter" href="UChar.html">
<link title="UTF8" rel="Chapter" href="UTF8.html">
<link title="Unzip" rel="Chapter" href="Unzip.html"><link title="New Functions" rel="Section" href="#6_NewFunctions">
<link title="Compatibility Functions" rel="Section" href="#6_CompatibilityFunctions">
<link title="Older Functions" rel="Section" href="#6_OlderFunctions">
<title>ExtLib.String</title>
</head>
<body>
<div class="navbar"><a class="pre" href="ExtLib.List.html" title="ExtLib.List">Previous</a>
&nbsp;<a class="up" href="ExtLib.html" title="ExtLib">Up</a>
&nbsp;<a class="post" href="ExtLib.Hashtbl.html" title="ExtLib.Hashtbl">Next</a>
</div>
<h1>Module <a href="type_ExtLib.String.html">ExtLib.String</a></h1>

<pre><span id="MODULEString"><span class="keyword">module</span> String</span>: <code class="type"><a href="ExtString.String.html">ExtString.String</a></code></pre><hr width="100%">
<h7 id="6_NewFunctions">New Functions</h7>
<pre><span id="VALinit"><span class="keyword">val</span> init</span> : <code class="type">int -> (int -> char) -> string</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">init l f</code> returns the string of length <code class="code">l</code> with the chars
      f 0 , f 1 , f 2 ... f (l-1).</p>
</div>
</div>

<pre><span id="VALfind"><span class="keyword">val</span> find</span> : <code class="type">string -> string -> int</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">find s x</code> returns the starting index of the string <code class="code">x</code>
      within the string <code class="code">s</code> or raises <code class="code">Invalid_string</code> if <code class="code">x</code>
      is not a substring of <code class="code">s</code>.</p>
</div>
</div>

<pre><span id="VALfind_from"><span class="keyword">val</span> find_from</span> : <code class="type">string -> int -> string -> int</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">find s i x</code> returns the starting index of the string <code class="code">x</code>
      within the string <code class="code">s</code> (starting search from position <code class="code">i</code>) or
      raises <code class="code">Invalid_string</code> if no such substring exists.
      <code class="code">find s x</code> is equivalent to <code class="code">find_from s 0 x</code>.</p>
</div>
</div>

<pre><span id="VALsplit"><span class="keyword">val</span> split</span> : <code class="type">string -> string -> string * string</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">split s sep</code> splits the string <code class="code">s</code> between the first
      occurrence of <code class="code">sep</code>.
      raises <code class="code">Invalid_string</code> if the separator is not found.</p>
</div>
</div>

<pre><span id="VALnsplit"><span class="keyword">val</span> nsplit</span> : <code class="type">string -> string -> string list</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">nsplit s sep</code> splits the string <code class="code">s</code> into a list of strings
    which are separated by <code class="code">sep</code>.
                <code class="code">nsplit "" _</code> returns the empty list.</p>
</div>
<ul class="info-attributes">
<li><b>Raises</b> <code>Invalid_string</code> if <code class="code">sep</code> is empty string.</li>
</ul>
</div>

<pre><span id="VALjoin"><span class="keyword">val</span> join</span> : <code class="type">string -> string list -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Same as <code class="code">concat</code></p>
</div>
</div>

<pre><span id="VALslice"><span class="keyword">val</span> slice</span> : <code class="type">?first:int -> ?last:int -> string -> string</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">slice ?first ?last s</code> returns a "slice" of the string
    which corresponds to the characters <code class="code">s.[first]</code>,
    <code class="code">s.[first+1]</code>, ..., <code class="code">s[last-1]</code>. Note that the character at
    index <code class="code">last</code> is <b>not</b> included! If <code class="code">first</code> is omitted it
    defaults to the start of the string, i.e. index 0, and if
    <code class="code">last</code> is omitted is defaults to point just past the end of
    <code class="code">s</code>, i.e. <code class="code">length s</code>.  Thus, <code class="code">slice s</code> is equivalent to
    <code class="code">copy s</code>.</p>

<p>Negative indexes are interpreted as counting from the end of
    the string. For example, <code class="code">slice ~last:-2 s</code> will return the
    string <code class="code">s</code>, but without the last two characters.</p>

<p>This function <b>never</b> raises any exceptions. If the
    indexes are out of bounds they are automatically clipped.</p>
</div>
</div>

<pre><span id="VALlchop"><span class="keyword">val</span> lchop</span> : <code class="type">string -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Returns the same string but without the first character.
      does nothing if the string is empty.</p>
</div>
</div>

<pre><span id="VALrchop"><span class="keyword">val</span> rchop</span> : <code class="type">string -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Returns the same string but without the last character.
     does nothing if the string is empty.</p>
</div>
</div>

<pre><span id="VALof_int"><span class="keyword">val</span> of_int</span> : <code class="type">int -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Returns the string representation of an int.</p>
</div>
</div>

<pre><span id="VALof_float"><span class="keyword">val</span> of_float</span> : <code class="type">float -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Returns the string representation of an float.</p>
</div>
</div>

<pre><span id="VALof_char"><span class="keyword">val</span> of_char</span> : <code class="type">char -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Returns a string containing one given character.</p>
</div>
</div>

<pre><span id="VALto_int"><span class="keyword">val</span> to_int</span> : <code class="type">string -> int</code></pre><div class="info ">
<div class="info-desc">
<p>Returns the integer represented by the given string or
      raises <code class="code">Invalid_string</code> if the string does not represent an integer.</p>
</div>
</div>

<pre><span id="VALto_float"><span class="keyword">val</span> to_float</span> : <code class="type">string -> float</code></pre><div class="info ">
<div class="info-desc">
<p>Returns the float represented by the given string or
      raises Invalid_string if the string does not represent a float.</p>
</div>
</div>

<pre><span id="VALends_with"><span class="keyword">val</span> ends_with</span> : <code class="type">string -> string -> bool</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">ends_with s x</code> returns true if the string <code class="code">s</code> is ending with <code class="code">x</code>.</p>
</div>
</div>

<pre><span id="VALstarts_with"><span class="keyword">val</span> starts_with</span> : <code class="type">string -> string -> bool</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">starts_with s x</code> return true if <code class="code">s</code> is starting with <code class="code">x</code>.</p>
</div>
</div>

<pre><span id="VALenum"><span class="keyword">val</span> enum</span> : <code class="type">string -> char <a href="Enum.html#TYPEt">Enum.t</a></code></pre><div class="info ">
<div class="info-desc">
<p>Returns an enumeration of the characters of a string.</p>
</div>
</div>

<pre><span id="VALof_enum"><span class="keyword">val</span> of_enum</span> : <code class="type">char <a href="Enum.html#TYPEt">Enum.t</a> -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Creates a string from a character enumeration.</p>
</div>
</div>

<pre><span id="VALmap"><span class="keyword">val</span> map</span> : <code class="type">(char -> char) -> string -> string</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">map f s</code> returns a string where all characters <code class="code">c</code> in <code class="code">s</code> have been
    replaced by <code class="code">f c</code>. *</p>
</div>
</div>

<pre><span id="VALmapi"><span class="keyword">val</span> mapi</span> : <code class="type">(int -> char -> char) -> string -> string</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">map f s</code> returns a string where all characters <code class="code">c</code> in <code class="code">s</code> have been replaced by <code class="code">f i s.[i]</code>. *</p>
</div>
</div>

<pre><span id="VALiteri"><span class="keyword">val</span> iteri</span> : <code class="type">(int -> char -> unit) -> string -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Call <code class="code">f i s.[i]</code> for every position <code class="code">i</code> in string</p>
</div>
</div>

<pre><span id="VALfold_left"><span class="keyword">val</span> fold_left</span> : <code class="type">('a -> char -> 'a) -> 'a -> string -> 'a</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">fold_left f a s</code> is
        <code class="code">f (... (f (f a s.[0]) s.[1]) ...) s.[n-1]</code></p>
</div>
</div>

<pre><span id="VALfold_right"><span class="keyword">val</span> fold_right</span> : <code class="type">(char -> 'a -> 'a) -> string -> 'a -> 'a</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">fold_right f s b</code> is
        <code class="code">f s.[0] (f s.[1] (... (f s.[n-1] b) ...))</code></p>
</div>
</div>

<pre><span id="VALexplode"><span class="keyword">val</span> explode</span> : <code class="type">string -> char list</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">explode s</code> returns the list of characters in the string <code class="code">s</code>.</p>
</div>
</div>

<pre><span id="VALimplode"><span class="keyword">val</span> implode</span> : <code class="type">char list -> string</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">implode cs</code> returns a string resulting from concatenating
        the characters in the list <code class="code">cs</code>.</p>
</div>
</div>

<pre><span id="VALstrip"><span class="keyword">val</span> strip</span> : <code class="type">?chars:string -> string -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Returns the string without the chars if they are at the beginning or
    at the end of the string. By default chars are " \t\r\n".</p>
</div>
</div>

<pre><span id="VALexists"><span class="keyword">val</span> exists</span> : <code class="type">string -> string -> bool</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">exists str sub</code> returns true if <code class="code">sub</code> is a substring of <code class="code">str</code> or
    false otherwise.</p>
</div>
</div>

<pre><span id="VALreplace_chars"><span class="keyword">val</span> replace_chars</span> : <code class="type">(char -> string) -> string -> string</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">replace_chars f s</code> returns a string where all chars <code class="code">c</code> of <code class="code">s</code> have been
    replaced by the string returned by <code class="code">f c</code>.</p>
</div>
</div>

<pre><span id="VALreplace"><span class="keyword">val</span> replace</span> : <code class="type">str:string -> sub:string -> by:string -> bool * string</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">replace ~str ~sub ~by</code> returns a tuple constisting of a boolean
    and a string where the first occurrence of the string <code class="code">sub</code>
    within <code class="code">str</code> has been replaced by the string <code class="code">by</code>. The boolean
    is true if a subtitution has taken place.</p>
</div>
</div>

<pre><span id="VALtrim"><span class="keyword">val</span> trim</span> : <code class="type">string -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Return a copy of the argument, without leading and trailing
     whitespace.  The characters regarded as whitespace are: <code class="code">' '</code>,
     <code class="code">'\012'</code>, <code class="code">'\n'</code>, <code class="code">'\r'</code>, and <code class="code">'\t'</code>.
     (Note that it is different from <a href="ExtString.String.html#VALstrip"><code class="code">ExtString.String.strip</code></a> defaults).</p>
</div>
</div>
<h7 id="6_CompatibilityFunctions">Compatibility Functions</h7>
<pre><span id="VALuppercase_ascii"><span class="keyword">val</span> uppercase_ascii</span> : <code class="type">string -> string</code></pre>
<pre><span id="VALlowercase_ascii"><span class="keyword">val</span> lowercase_ascii</span> : <code class="type">string -> string</code></pre>
<pre><span id="VALcapitalize_ascii"><span class="keyword">val</span> capitalize_ascii</span> : <code class="type">string -> string</code></pre>
<pre><span id="VALuncapitalize_ascii"><span class="keyword">val</span> uncapitalize_ascii</span> : <code class="type">string -> string</code></pre>
<pre><span id="VALsplit_on_char"><span class="keyword">val</span> split_on_char</span> : <code class="type">char -> string -> string list</code></pre><h7 id="6_OlderFunctions">Older Functions</h7><p>Please refer to the Ocaml Manual for documentation of these
    functions.</p>

<pre><span id="VALlength"><span class="keyword">val</span> length</span> : <code class="type">string -> int</code></pre>
<pre><span id="VALget"><span class="keyword">val</span> get</span> : <code class="type">string -> int -> char</code></pre>
<pre><span id="VALset"><span class="keyword">val</span> set</span> : <code class="type">ExtBytes.Bytes.t -> int -> char -> unit</code></pre>
<pre><span id="VALcreate"><span class="keyword">val</span> create</span> : <code class="type">int -> ExtBytes.Bytes.t</code></pre>
<pre><span id="VALmake"><span class="keyword">val</span> make</span> : <code class="type">int -> char -> string</code></pre>
<pre><span id="VALcopy"><span class="keyword">val</span> copy</span> : <code class="type">string -> string</code></pre>
<pre><span id="VALsub"><span class="keyword">val</span> sub</span> : <code class="type">string -> int -> int -> string</code></pre>
<pre><span id="VALfill"><span class="keyword">val</span> fill</span> : <code class="type">ExtBytes.Bytes.t -> int -> int -> char -> unit</code></pre>
<pre><span id="VALblit"><span class="keyword">val</span> blit</span> : <code class="type">string -> int -> ExtBytes.Bytes.t -> int -> int -> unit</code></pre>
<pre><span id="VALconcat"><span class="keyword">val</span> concat</span> : <code class="type">string -> string list -> string</code></pre>
<pre><span id="VALiter"><span class="keyword">val</span> iter</span> : <code class="type">(char -> unit) -> string -> unit</code></pre>
<pre><span id="VALescaped"><span class="keyword">val</span> escaped</span> : <code class="type">string -> string</code></pre>
<pre><span id="VALindex"><span class="keyword">val</span> index</span> : <code class="type">string -> char -> int</code></pre>
<pre><span id="VALindex_opt"><span class="keyword">val</span> index_opt</span> : <code class="type">string -> char -> int option</code></pre>
<pre><span id="VALrindex"><span class="keyword">val</span> rindex</span> : <code class="type">string -> char -> int</code></pre>
<pre><span id="VALrindex_opt"><span class="keyword">val</span> rindex_opt</span> : <code class="type">string -> char -> int option</code></pre>
<pre><span id="VALindex_from"><span class="keyword">val</span> index_from</span> : <code class="type">string -> int -> char -> int</code></pre>
<pre><span id="VALindex_from_opt"><span class="keyword">val</span> index_from_opt</span> : <code class="type">string -> int -> char -> int option</code></pre>
<pre><span id="VALrindex_from"><span class="keyword">val</span> rindex_from</span> : <code class="type">string -> int -> char -> int</code></pre>
<pre><span id="VALrindex_from_opt"><span class="keyword">val</span> rindex_from_opt</span> : <code class="type">string -> int -> char -> int option</code></pre>
<pre><span id="VALcontains"><span class="keyword">val</span> contains</span> : <code class="type">string -> char -> bool</code></pre>
<pre><span id="VALcontains_from"><span class="keyword">val</span> contains_from</span> : <code class="type">string -> int -> char -> bool</code></pre>
<pre><span id="VALrcontains_from"><span class="keyword">val</span> rcontains_from</span> : <code class="type">string -> int -> char -> bool</code></pre>
<pre><span id="VALuppercase"><span class="keyword">val</span> uppercase</span> : <code class="type">string -> string</code></pre>
<pre><span id="VALlowercase"><span class="keyword">val</span> lowercase</span> : <code class="type">string -> string</code></pre>
<pre><span id="VALcapitalize"><span class="keyword">val</span> capitalize</span> : <code class="type">string -> string</code></pre>
<pre><span id="VALuncapitalize"><span class="keyword">val</span> uncapitalize</span> : <code class="type">string -> string</code></pre>
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = <code class="type">string</code> </pre>


<pre><span id="VALcompare"><span class="keyword">val</span> compare</span> : <code class="type"><a href="ExtString.String.html#TYPEt">t</a> -> <a href="ExtString.String.html#TYPEt">t</a> -> int</code></pre>
<pre><span id="VALequal"><span class="keyword">val</span> equal</span> : <code class="type"><a href="ExtString.String.html#TYPEt">t</a> -> <a href="ExtString.String.html#TYPEt">t</a> -> bool</code></pre>
<pre><span id="VALto_seq"><span class="keyword">val</span> to_seq</span> : <code class="type"><a href="ExtString.String.html#TYPEt">t</a> -> char Stdlib.Seq.t</code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">*_seq</code> functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions</p>
</div>
</div>

<pre><span id="VALto_seqi"><span class="keyword">val</span> to_seqi</span> : <code class="type"><a href="ExtString.String.html#TYPEt">t</a> -> (int * char) Stdlib.Seq.t</code></pre>
<pre><span id="VALof_seq"><span class="keyword">val</span> of_seq</span> : <code class="type">char Stdlib.Seq.t -> <a href="ExtString.String.html#TYPEt">t</a></code></pre></body></html>