mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
2 lines
No EOL
6.5 KiB
HTML
2 lines
No EOL
6.5 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Sub (containers.CCStringLabels.Sub)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">containers</a> » <a href="../index.html">CCStringLabels</a> » Sub</nav><h1>Module <code>CCStringLabels.Sub</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = string * int * int</code></dt><dd><p>A string, an offset, and the length of the slice.</p></dd></dl><dl><dt class="spec value" id="val-make"><a href="#val-make" class="anchor"></a><code><span class="keyword">val</span> make : string <span>-></span> pos:int <span>-></span> len:int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-full"><a href="#val-full" class="anchor"></a><code><span class="keyword">val</span> full : string <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Full string.</p></dd></dl><dl><dt class="spec value" id="val-copy"><a href="#val-copy" class="anchor"></a><code><span class="keyword">val</span> copy : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>Make a copy of the substring.</p></dd></dl><dl><dt class="spec value" id="val-underlying"><a href="#val-underlying" class="anchor"></a><code><span class="keyword">val</span> underlying : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dt class="spec value" id="val-sub"><a href="#val-sub" class="anchor"></a><code><span class="keyword">val</span> sub : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Sub-slice.</p></dd></dl><dl><dt class="spec value" id="val-get"><a href="#val-get" class="anchor"></a><code><span class="keyword">val</span> get : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> char</code></dt><dd><p><code>get s i</code> gets the <code>i</code>-th element, or fails.</p><dl><dt>raises Invalid_argument</dt><dd><p>if the index is not within <code>0 ... length - 1</code>.</p></dd></dl><dl><dt>since</dt><dd>1.2</dd></dl></dd></dl><div><div class="spec include"><div class="doc"><details open="open"><summary><span class="def"><code><span class="keyword">include</span> <a href="../index.html#module-type-S">S</a> <span class="keyword">with</span> <span class="keyword">type</span> <a href="../module-type-S/index.html#type-t">t</a> := <a href="index.html#type-t">t</a></code></span></summary><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code></dt></dl><dl><dt class="spec value" id="val-length"><a href="#val-length" class="anchor"></a><code><span class="keyword">val</span> length : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p>Return the length (number of characters) of the given string.</p></dd></dl><dl><dt class="spec value" id="val-blit"><a href="#val-blit" class="anchor"></a><code><span class="keyword">val</span> blit : src:<a href="index.html#type-t">t</a> <span>-></span> src_pos:int <span>-></span> dst:Stdlib.Bytes.t <span>-></span> dst_pos:int <span>-></span> len:int <span>-></span> unit</code></dt><dd><p>Like <span class="xref-unresolved" title="unresolved reference to "String.blit""><code>String</code>.blit</span>. Compatible with the <code>-safe-string</code> option.</p><dl><dt>raises Invalid_argument</dt><dd><p>if indices are not valid.</p></dd></dl></dd></dl><dl><dt class="spec value" id="val-fold"><a href="#val-fold" class="anchor"></a><code><span class="keyword">val</span> fold : f:(<span class="type-var">'a</span> <span>-></span> char <span>-></span> <span class="type-var">'a</span>) <span>-></span> init:<span class="type-var">'a</span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'a</span></code></dt><dd><p>Fold on chars by increasing index.</p><dl><dt>since</dt><dd>0.7</dd></dl></dd></dl><section><header><h3 id="conversions"><a href="#conversions" class="anchor"></a>Conversions</h3></header><dl><dt class="spec value" id="val-to_gen"><a href="#val-to_gen" class="anchor"></a><code><span class="keyword">val</span> to_gen : <a href="index.html#type-t">t</a> <span>-></span> char <a href="../index.html#type-gen">gen</a></code></dt><dd><p>Return the <code>gen</code> of characters contained in the string.</p></dd></dl><dl><dt class="spec value" id="val-to_seq"><a href="#val-to_seq" class="anchor"></a><code><span class="keyword">val</span> to_seq : <a href="index.html#type-t">t</a> <span>-></span> char <a href="../index.html#type-sequence">sequence</a></code></dt><dd><p>Return the <code>sequence</code> of characters contained in the string.</p></dd></dl><dl><dt class="spec value" id="val-to_klist"><a href="#val-to_klist" class="anchor"></a><code><span class="keyword">val</span> to_klist : <a href="index.html#type-t">t</a> <span>-></span> char <a href="../index.html#type-klist">klist</a></code></dt><dd><p>Return the <code>klist</code> of characters contained in the string.</p></dd></dl><dl><dt class="spec value" id="val-to_list"><a href="#val-to_list" class="anchor"></a><code><span class="keyword">val</span> to_list : <a href="index.html#type-t">t</a> <span>-></span> char list</code></dt><dd><p>Return the list of characters contained in the string.</p></dd></dl><dl><dt class="spec value" id="val-pp_buf"><a href="#val-pp_buf" class="anchor"></a><code><span class="keyword">val</span> pp_buf : Stdlib.Buffer.t <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p>Renamed from <code>pp</code> since 2.0.</p></dd></dl><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : Stdlib.Format.formatter <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p>Print the string within quotes.</p><p>Renamed from <code>print</code> since 2.0.</p></dd></dl></section></details></div></div></div></div></body></html> |