1311 lines
14 KiB
HTML
1311 lines
14 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Stdlib.StringLabels</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Stdlib.StringLabels</H1>
|
|
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Stdlib.StringLabels - no description
|
|
<A NAME="lbAC"> </A>
|
|
<H2>Module</H2>
|
|
|
|
Module Stdlib.StringLabels
|
|
<A NAME="lbAD"> </A>
|
|
<H2>Documentation</H2>
|
|
|
|
<P>
|
|
Module
|
|
<B>StringLabels</B>
|
|
|
|
<BR> :
|
|
<B>(module Stdlib__stringLabels)</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val length </I>
|
|
|
|
:
|
|
<B>string -> int</B>
|
|
|
|
<P>
|
|
Return the length (number of characters) of the given string.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val get </I>
|
|
|
|
:
|
|
<B>string -> int -> char</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.get s n</B>
|
|
|
|
returns the character at index
|
|
<B>n</B>
|
|
|
|
in string
|
|
<B>s</B>
|
|
|
|
.
|
|
You can also write
|
|
<B>s.[n]</B>
|
|
|
|
instead of
|
|
<B>String.get s n</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>n</B>
|
|
|
|
not a valid index in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val set </I>
|
|
|
|
:
|
|
<B>bytes -> int -> char -> unit</B>
|
|
|
|
<P>
|
|
<B>Deprecated.</B>
|
|
|
|
This is a deprecated alias of
|
|
<B>BytesLabels.set</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<B>String.set s n c</B>
|
|
|
|
modifies byte sequence
|
|
<B>s</B>
|
|
|
|
in place,
|
|
replacing the byte at index
|
|
<B>n</B>
|
|
|
|
with
|
|
<B>c</B>
|
|
|
|
.
|
|
You can also write
|
|
<B>s.[n] <- c</B>
|
|
|
|
instead of
|
|
<B>String.set s n c</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>n</B>
|
|
|
|
is not a valid index in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val create </I>
|
|
|
|
:
|
|
<B>int -> bytes</B>
|
|
|
|
<P>
|
|
<B>Deprecated.</B>
|
|
|
|
This is a deprecated alias of
|
|
<B>BytesLabels.create</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<B>String.create n</B>
|
|
|
|
returns a fresh byte sequence of length
|
|
<B>n</B>
|
|
|
|
.
|
|
The sequence is uninitialized and contains arbitrary bytes.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>n < 0</B>
|
|
|
|
or
|
|
<B>n > </B>
|
|
|
|
<B>Sys.max_string_length</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val make </I>
|
|
|
|
:
|
|
<B>int -> char -> string</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.make n c</B>
|
|
|
|
returns a fresh string of length
|
|
<B>n</B>
|
|
|
|
,
|
|
filled with the character
|
|
<B>c</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>n < 0</B>
|
|
|
|
or
|
|
<B>n > </B>
|
|
|
|
<B>Sys.max_string_length</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val init </I>
|
|
|
|
:
|
|
<B>int -> f:(int -> char) -> string</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>init n f</B>
|
|
|
|
returns a string of length
|
|
<B>n</B>
|
|
|
|
,
|
|
with character
|
|
<B>i</B>
|
|
|
|
initialized to the result of
|
|
<B>f i</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>n < 0</B>
|
|
|
|
or
|
|
<B>n > </B>
|
|
|
|
<B>Sys.max_string_length</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.02.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val copy </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
Return a copy of the given string.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val sub </I>
|
|
|
|
:
|
|
<B>string -> pos:int -> len:int -> string</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.sub s start len</B>
|
|
|
|
returns a fresh string of length
|
|
<B>len</B>
|
|
|
|
,
|
|
containing the substring of
|
|
<B>s</B>
|
|
|
|
that starts at position
|
|
<B>start</B>
|
|
|
|
and
|
|
has length
|
|
<B>len</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>start</B>
|
|
|
|
and
|
|
<B>len</B>
|
|
|
|
do not
|
|
designate a valid substring of
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val fill </I>
|
|
|
|
:
|
|
<B>bytes -> pos:int -> len:int -> char -> unit</B>
|
|
|
|
<P>
|
|
<B>Deprecated.</B>
|
|
|
|
This is a deprecated alias of
|
|
<B>BytesLabels.fill</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<B>String.fill s start len c</B>
|
|
|
|
modifies byte sequence
|
|
<B>s</B>
|
|
|
|
in place,
|
|
replacing
|
|
<B>len</B>
|
|
|
|
bytes by
|
|
<B>c</B>
|
|
|
|
, starting at
|
|
<B>start</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>start</B>
|
|
|
|
and
|
|
<B>len</B>
|
|
|
|
do not
|
|
designate a valid substring of
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val blit </I>
|
|
|
|
:
|
|
<B>src:string -> src_pos:int -> dst:bytes -> dst_pos:int -> len:int -> unit</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.blit src srcoff dst dstoff len</B>
|
|
|
|
copies
|
|
<B>len</B>
|
|
|
|
bytes
|
|
from the string
|
|
<B>src</B>
|
|
|
|
, starting at index
|
|
<B>srcoff</B>
|
|
|
|
,
|
|
to byte sequence
|
|
<B>dst</B>
|
|
|
|
, starting at character number
|
|
<B>dstoff</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>srcoff</B>
|
|
|
|
and
|
|
<B>len</B>
|
|
|
|
do not
|
|
designate a valid range of
|
|
<B>src</B>
|
|
|
|
, or if
|
|
<B>dstoff</B>
|
|
|
|
and
|
|
<B>len</B>
|
|
|
|
do not designate a valid range of
|
|
<B>dst</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val concat </I>
|
|
|
|
:
|
|
<B>sep:string -> string list -> string</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.concat sep sl</B>
|
|
|
|
concatenates the list of strings
|
|
<B>sl</B>
|
|
|
|
,
|
|
inserting the separator string
|
|
<B>sep</B>
|
|
|
|
between each.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val iter </I>
|
|
|
|
:
|
|
<B>f:(char -> unit) -> string -> unit</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.iter f s</B>
|
|
|
|
applies function
|
|
<B>f</B>
|
|
|
|
in turn to all
|
|
the characters of
|
|
<B>s</B>
|
|
|
|
. It is equivalent to
|
|
<B>f s.[0]; f s.[1]; ...; f s.[String.length s - 1]; ()</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val iteri </I>
|
|
|
|
:
|
|
<B>f:(int -> char -> unit) -> string -> unit</B>
|
|
|
|
<P>
|
|
Same as
|
|
<B>String.iter</B>
|
|
|
|
, but the
|
|
function is applied to the index of the element as first argument
|
|
(counting from 0), and the character itself as second argument.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.00.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val map </I>
|
|
|
|
:
|
|
<B>f:(char -> char) -> string -> string</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.map f s</B>
|
|
|
|
applies function
|
|
<B>f</B>
|
|
|
|
in turn to all
|
|
the characters of
|
|
<B>s</B>
|
|
|
|
and stores the results in a new string that
|
|
is returned.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.00.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val mapi </I>
|
|
|
|
:
|
|
<B>f:(int -> char -> char) -> string -> string</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.mapi f s</B>
|
|
|
|
calls
|
|
<B>f</B>
|
|
|
|
with each character of
|
|
<B>s</B>
|
|
|
|
and its
|
|
index (in increasing index order) and stores the results in a new
|
|
string that is returned.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.02.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val trim </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
Return a copy of the argument, without leading and trailing
|
|
whitespace. The characters regarded as whitespace are:
|
|
<B>' '</B>
|
|
|
|
,
|
|
<B>'\012'</B>
|
|
|
|
,
|
|
<B>'\n'</B>
|
|
|
|
,
|
|
<B>'\r'</B>
|
|
|
|
, and
|
|
<B>'\t'</B>
|
|
|
|
. If there is no leading nor
|
|
trailing whitespace character in the argument, return the original
|
|
string itself, not a copy.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.00.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val escaped </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
Return a copy of the argument, with special characters
|
|
represented by escape sequences, following the lexical
|
|
conventions of OCaml. If there is no special
|
|
character in the argument, return the original string itself,
|
|
not a copy. Its inverse function is Scanf.unescaped.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val index </I>
|
|
|
|
:
|
|
<B>string -> char -> int</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.index s c</B>
|
|
|
|
returns the index of the first
|
|
occurrence of character
|
|
<B>c</B>
|
|
|
|
in string
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Not_found</B>
|
|
|
|
if
|
|
<B>c</B>
|
|
|
|
does not occur in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val index_opt </I>
|
|
|
|
:
|
|
<B>string -> char -> int option</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.index_opt s c</B>
|
|
|
|
returns the index of the first
|
|
occurrence of character
|
|
<B>c</B>
|
|
|
|
in string
|
|
<B>s</B>
|
|
|
|
, or
|
|
<B>None</B>
|
|
|
|
if
|
|
<B>c</B>
|
|
|
|
does not occur in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rindex </I>
|
|
|
|
:
|
|
<B>string -> char -> int</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.rindex s c</B>
|
|
|
|
returns the index of the last
|
|
occurrence of character
|
|
<B>c</B>
|
|
|
|
in string
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Not_found</B>
|
|
|
|
if
|
|
<B>c</B>
|
|
|
|
does not occur in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rindex_opt </I>
|
|
|
|
:
|
|
<B>string -> char -> int option</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.rindex_opt s c</B>
|
|
|
|
returns the index of the last occurrence
|
|
of character
|
|
<B>c</B>
|
|
|
|
in string
|
|
<B>s</B>
|
|
|
|
, or
|
|
<B>None</B>
|
|
|
|
if
|
|
<B>c</B>
|
|
|
|
does not occur in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val index_from </I>
|
|
|
|
:
|
|
<B>string -> int -> char -> int</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.index_from s i c</B>
|
|
|
|
returns the index of the
|
|
first occurrence of character
|
|
<B>c</B>
|
|
|
|
in string
|
|
<B>s</B>
|
|
|
|
after position
|
|
<B>i</B>
|
|
|
|
.
|
|
<B>String.index s c</B>
|
|
|
|
is equivalent to
|
|
<B>String.index_from s 0 c</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>i</B>
|
|
|
|
is not a valid position in
|
|
<B>s</B>
|
|
|
|
.
|
|
Raise
|
|
<B>Not_found</B>
|
|
|
|
if
|
|
<B>c</B>
|
|
|
|
does not occur in
|
|
<B>s</B>
|
|
|
|
after position
|
|
<B>i</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val index_from_opt </I>
|
|
|
|
:
|
|
<B>string -> int -> char -> int option</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.index_from_opt s i c</B>
|
|
|
|
returns the index of the
|
|
first occurrence of character
|
|
<B>c</B>
|
|
|
|
in string
|
|
<B>s</B>
|
|
|
|
after position
|
|
<B>i</B>
|
|
|
|
or
|
|
<B>None</B>
|
|
|
|
if
|
|
<B>c</B>
|
|
|
|
does not occur in
|
|
<B>s</B>
|
|
|
|
after position
|
|
<B>i</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<B>String.index_opt s c</B>
|
|
|
|
is equivalent to
|
|
<B>String.index_from_opt s 0 c</B>
|
|
|
|
.
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>i</B>
|
|
|
|
is not a valid position in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rindex_from </I>
|
|
|
|
:
|
|
<B>string -> int -> char -> int</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.rindex_from s i c</B>
|
|
|
|
returns the index of the
|
|
last occurrence of character
|
|
<B>c</B>
|
|
|
|
in string
|
|
<B>s</B>
|
|
|
|
before position
|
|
<B>i+1</B>
|
|
|
|
.
|
|
<B>String.rindex s c</B>
|
|
|
|
is equivalent to
|
|
<B>String.rindex_from s (String.length s - 1) c</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>i+1</B>
|
|
|
|
is not a valid position in
|
|
<B>s</B>
|
|
|
|
.
|
|
Raise
|
|
<B>Not_found</B>
|
|
|
|
if
|
|
<B>c</B>
|
|
|
|
does not occur in
|
|
<B>s</B>
|
|
|
|
before position
|
|
<B>i+1</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rindex_from_opt </I>
|
|
|
|
:
|
|
<B>string -> int -> char -> int option</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.rindex_from_opt s i c</B>
|
|
|
|
returns the index of the
|
|
last occurrence of character
|
|
<B>c</B>
|
|
|
|
in string
|
|
<B>s</B>
|
|
|
|
before position
|
|
<B>i+1</B>
|
|
|
|
or
|
|
<B>None</B>
|
|
|
|
if
|
|
<B>c</B>
|
|
|
|
does not occur in
|
|
<B>s</B>
|
|
|
|
before position
|
|
<B>i+1</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<B>String.rindex_opt s c</B>
|
|
|
|
is equivalent to
|
|
<B>String.rindex_from_opt s (String.length s - 1) c</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>i+1</B>
|
|
|
|
is not a valid position in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val contains </I>
|
|
|
|
:
|
|
<B>string -> char -> bool</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.contains s c</B>
|
|
|
|
tests if character
|
|
<B>c</B>
|
|
|
|
appears in the string
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val contains_from </I>
|
|
|
|
:
|
|
<B>string -> int -> char -> bool</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.contains_from s start c</B>
|
|
|
|
tests if character
|
|
<B>c</B>
|
|
|
|
appears in
|
|
<B>s</B>
|
|
|
|
after position
|
|
<B>start</B>
|
|
|
|
.
|
|
<B>String.contains s c</B>
|
|
|
|
is equivalent to
|
|
<B>String.contains_from s 0 c</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>start</B>
|
|
|
|
is not a valid position in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rcontains_from </I>
|
|
|
|
:
|
|
<B>string -> int -> char -> bool</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.rcontains_from s stop c</B>
|
|
|
|
tests if character
|
|
<B>c</B>
|
|
|
|
appears in
|
|
<B>s</B>
|
|
|
|
before position
|
|
<B>stop+1</B>
|
|
|
|
.
|
|
<P>
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if
|
|
<B>stop < 0</B>
|
|
|
|
or
|
|
<B>stop+1</B>
|
|
|
|
is not a valid
|
|
position in
|
|
<B>s</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val uppercase </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
<B>Deprecated.</B>
|
|
|
|
Functions operating on Latin-1 character set are deprecated.
|
|
<P>
|
|
<P>
|
|
Return a copy of the argument, with all lowercase letters
|
|
translated to uppercase, including accented letters of the ISO
|
|
Latin-1 (8859-1) character set.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val lowercase </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
<B>Deprecated.</B>
|
|
|
|
Functions operating on Latin-1 character set are deprecated.
|
|
<P>
|
|
<P>
|
|
Return a copy of the argument, with all uppercase letters
|
|
translated to lowercase, including accented letters of the ISO
|
|
Latin-1 (8859-1) character set.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val capitalize </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
<B>Deprecated.</B>
|
|
|
|
Functions operating on Latin-1 character set are deprecated.
|
|
<P>
|
|
<P>
|
|
Return a copy of the argument, with the first character set to uppercase,
|
|
using the ISO Latin-1 (8859-1) character set..
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val uncapitalize </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
<B>Deprecated.</B>
|
|
|
|
Functions operating on Latin-1 character set are deprecated.
|
|
<P>
|
|
<P>
|
|
Return a copy of the argument, with the first character set to lowercase,
|
|
using the ISO Latin-1 (8859-1) character set..
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val uppercase_ascii </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
Return a copy of the argument, with all lowercase letters
|
|
translated to uppercase, using the US-ASCII character set.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val lowercase_ascii </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
Return a copy of the argument, with all uppercase letters
|
|
translated to lowercase, using the US-ASCII character set.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val capitalize_ascii </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
Return a copy of the argument, with the first character set to uppercase,
|
|
using the US-ASCII character set.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val uncapitalize_ascii </I>
|
|
|
|
:
|
|
<B>string -> string</B>
|
|
|
|
<P>
|
|
Return a copy of the argument, with the first character set to lowercase,
|
|
using the US-ASCII character set.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05.0
|
|
<P>
|
|
<P>
|
|
<I>type t </I>
|
|
|
|
=
|
|
<B>string</B>
|
|
|
|
<P>
|
|
<P>
|
|
An alias for the type of strings.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val compare </I>
|
|
|
|
:
|
|
<B>t -> t -> int</B>
|
|
|
|
<P>
|
|
The comparison function for strings, with the same specification as
|
|
<B>compare</B>
|
|
|
|
. Along with the type
|
|
<B>t</B>
|
|
|
|
, this function
|
|
<B>compare</B>
|
|
|
|
allows the module
|
|
<B>String</B>
|
|
|
|
to be passed as argument to the functors
|
|
<B>Set.Make</B>
|
|
|
|
and
|
|
<B>Map.Make</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val equal </I>
|
|
|
|
:
|
|
<B>t -> t -> bool</B>
|
|
|
|
<P>
|
|
The equal function for strings.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val split_on_char </I>
|
|
|
|
:
|
|
<B>sep:char -> string -> string list</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>String.split_on_char sep s</B>
|
|
|
|
returns the list of all (possibly empty)
|
|
substrings of
|
|
<B>s</B>
|
|
|
|
that are delimited by the
|
|
<B>sep</B>
|
|
|
|
character.
|
|
<P>
|
|
The function's output is specified by the following invariants:
|
|
<P>
|
|
<P>
|
|
-The list is not empty.
|
|
<P>
|
|
-Concatenating its elements using
|
|
<B>sep</B>
|
|
|
|
as a separator returns a
|
|
string equal to the input (
|
|
<B>String.concat (String.make 1 sep)</B>
|
|
|
|
<B>(String.split_on_char sep s) = s</B>
|
|
|
|
).
|
|
<P>
|
|
-No string in the result contains the
|
|
<B>sep</B>
|
|
|
|
character.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H3>Iterators</H3>
|
|
|
|
<P>
|
|
<P>
|
|
|
|
<P>
|
|
<I>val to_seq </I>
|
|
|
|
:
|
|
<B>t -> char Seq.t</B>
|
|
|
|
<P>
|
|
Iterate on the string, in increasing index order. Modifications of the
|
|
string during iteration will be reflected in the iterator.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.07
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val to_seqi </I>
|
|
|
|
:
|
|
<B>t -> (int * char) Seq.t</B>
|
|
|
|
<P>
|
|
Iterate on the string, in increasing order, yielding indices along chars
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.07
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val of_seq </I>
|
|
|
|
:
|
|
<B>char Seq.t -> t</B>
|
|
|
|
<P>
|
|
Create a string from the generator
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.07
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">Module</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
|
|
<DL>
|
|
<DT id="4"><A HREF="#lbAE">Iterators</A><DD>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:57 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|