mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
add CCstring.of_char
This commit is contained in:
parent
9c76572e83
commit
103dfb8c73
2 changed files with 6 additions and 0 deletions
|
|
@ -475,6 +475,8 @@ let _to_gen s i0 len =
|
||||||
|
|
||||||
let to_gen s = _to_gen s 0 (String.length s)
|
let to_gen s = _to_gen s 0 (String.length s)
|
||||||
|
|
||||||
|
let of_char c = String.make 1 c
|
||||||
|
|
||||||
let of_gen g =
|
let of_gen g =
|
||||||
let b = Buffer.create 32 in
|
let b = Buffer.create 32 in
|
||||||
let rec aux () = match g () with
|
let rec aux () = match g () with
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,10 @@ val pad : ?side:[`Left|`Right] -> ?c:char -> int -> string -> string
|
||||||
"aaa" (pad ~side:`Right ~c:'a' 3 "")
|
"aaa" (pad ~side:`Right ~c:'a' 3 "")
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
val of_char : char -> string
|
||||||
|
(** [of_char 'a' = "a"]
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val of_gen : char gen -> string
|
val of_gen : char gen -> string
|
||||||
val of_seq : char sequence -> string
|
val of_seq : char sequence -> string
|
||||||
val of_klist : char klist -> string
|
val of_klist : char klist -> string
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue