Yocaml.Util
An invasive but probably useful tooling.
As I was not very serious... strings occupy a very large place in Wordpress... so it is necessary to be able to work correctly with them.
Even if sometimes, infix operators can seem unreadable... the immoderate use of Arrows has already made the code incomprehensible... so why deprive yourself?
include module type of Filepath
val with_extension : string -> t -> bool
with_extension ext path
returns true
if path
ends with ext
false
otherwise, ie: with_extension "html" "index.html"
returns true
but with_extenstion "html" "foohtml"
returns false
.
Add an extension to a t. For example: add_extension "index.txt" "html"
will produce "index.txt.html"
.