mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-16 23:56:43 -05:00
add CCChar.to_string
This commit is contained in:
parent
eb860afc29
commit
3dfbbeb3e3
2 changed files with 10 additions and 0 deletions
|
|
@ -16,6 +16,12 @@ let of_int_exn = Char.chr
|
||||||
let of_int c = try Some (of_int_exn c) with _ -> None
|
let of_int c = try Some (of_int_exn c) with _ -> None
|
||||||
let to_int = Char.code
|
let to_int = Char.code
|
||||||
|
|
||||||
|
let to_string c = String.make 1 c
|
||||||
|
|
||||||
|
(*$Q to_string
|
||||||
|
(Q.string_of_size (Q.Gen.return 1)) (fun s -> to_string s.[0] = s)
|
||||||
|
*)
|
||||||
|
|
||||||
let lowercase_ascii = function
|
let lowercase_ascii = function
|
||||||
| 'A'..'Z' as c -> Char.unsafe_chr (Char.code c + 32)
|
| 'A'..'Z' as c -> Char.unsafe_chr (Char.code c + 32)
|
||||||
| c -> c
|
| c -> c
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,10 @@ val to_int : t -> int
|
||||||
Return the ASCII code of the argument.
|
Return the ASCII code of the argument.
|
||||||
@since 1.0 *)
|
@since 1.0 *)
|
||||||
|
|
||||||
|
val to_string : t -> string
|
||||||
|
(** [to_string c] return a string containing [c]
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val pp_buf : Buffer.t -> t -> unit
|
val pp_buf : Buffer.t -> t -> unit
|
||||||
(** Renamed from [pp] since 2.0. *)
|
(** Renamed from [pp] since 2.0. *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue