Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
# String.create 10 ;;
- : string = "\000\023\000\000\001\000\000\000\000\000"

View file

@ -0,0 +1,2 @@
# "Now just remind me" ^ " how the horse moves again?" ;;
- : string = "Now just remind me how the horse moves again?"

View file

@ -0,0 +1,6 @@
# let str = "some text" ;;
val str : string = "some text"
(* modifying a character, OCaml strings are mutable *)
# str.[0] <- 'S' ;;
- : unit = ()

View file

@ -0,0 +1,5 @@
# str = "Some text" ;;
- : bool = true
# "Hello" > "Ciao" ;;
- : bool = true

View file

@ -0,0 +1,2 @@
# String.copy str ;;
- : string = "Some text"

View file

@ -0,0 +1,8 @@
# let string_is_empty s = (s = "") ;;
val string_is_empty : string -> bool = <fun>
# string_is_empty str ;;
- : bool = false
# string_is_empty "" ;;
- : bool = true

View file

@ -0,0 +1,2 @@
# str ^ "!" ;;
- : string = "Some text!"

View file

@ -0,0 +1 @@
Buffer.add_char str c

View file

@ -0,0 +1,2 @@
# String.sub str 5 4 ;;
- : string = "text"

View file

@ -0,0 +1,7 @@
# #load "str.cma";;
# let replace str occ by =
Str.global_replace (Str.regexp_string occ) by str
;;
val replace : string -> string -> string -> string = <fun>
# replace "The white dog let out a single, loud bark." "white" "black" ;;
- : string = "The black dog let out a single, loud bark."