1Char(3) OCaml library Char(3)
2
3
4
6 Char - Character operations.
7
9 Module Char
10
12 Module Char
13 : sig end
14
15
16 Character operations.
17
18
19
20
21
22
23 val code : char -> int
24
25 Return the ASCII code of the argument.
26
27
28
29 val chr : int -> char
30
31 Return the character with the given ASCII code.
32
33
34 Raises Invalid_argument if the argument is outside the range 0--255.
35
36
37
38 val escaped : char -> string
39
40 Return a string representing the given character, with special charac‐
41 ters escaped following the lexical conventions of OCaml. All charac‐
42 ters outside the ASCII printable range (32..126) are escaped, as well
43 as backslash, double-quote, and single-quote.
44
45
46
47 val lowercase_ascii : char -> char
48
49 Convert the given character to its equivalent lowercase character, us‐
50 ing the US-ASCII character set.
51
52
53 Since 4.03.0
54
55
56
57 val uppercase_ascii : char -> char
58
59 Convert the given character to its equivalent uppercase character, us‐
60 ing the US-ASCII character set.
61
62
63 Since 4.03.0
64
65
66 type t = char
67
68
69 An alias for the type of characters.
70
71
72
73 val compare : t -> t -> int
74
75 The comparison function for characters, with the same specification as
76 compare . Along with the type t , this function compare allows the
77 module Char to be passed as argument to the functors Set.Make and
78 Map.Make .
79
80
81
82 val equal : t -> t -> bool
83
84 The equal function for chars.
85
86
87 Since 4.03.0
88
89
90
91
92
93OCamldoc 2023-07-20 Char(3)