ocaml: phase 6 String extensions (+6 tests, 406 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
ends_with, contains, trim, split_on_char, replace_all, index_of — wrap host SX primitives via new _string_* builtins. String module now substantively covers OCaml's Stdlib.String.
This commit is contained in:
@@ -58,6 +58,15 @@
|
||||
(list "_string_upper" (fn (s) (upper s)))
|
||||
(list "_string_lower" (fn (s) (lower s)))
|
||||
(list "_string_starts_with" (fn (p) (fn (s) (starts-with? s p))))
|
||||
(list "_string_ends_with" (fn (p) (fn (s) (ends-with? s p))))
|
||||
(list "_string_contains" (fn (s) (fn (sub) (contains? s sub))))
|
||||
(list "_string_trim" (fn (s) (trim s)))
|
||||
(list "_string_split_on_char"
|
||||
(fn (sep) (fn (s) (split s sep))))
|
||||
(list "_string_replace"
|
||||
(fn (s) (fn (a) (fn (b) (replace s a b)))))
|
||||
(list "_string_index_of"
|
||||
(fn (s) (fn (sub) (index-of s sub))))
|
||||
(list "_int_of_string" (fn (s) (parse-number s)))
|
||||
(list "_string_of_int" (fn (i) (str i)))
|
||||
(list "_string_of_float" (fn (f) (str f)))
|
||||
|
||||
Reference in New Issue
Block a user