Closed vindarel closed 5 years ago
added in 0.4, january 8th 2018, waiting for Quicklisp release.
(filename)
Read the file and return its content as a string.
Example: (str:from-file "path/to/file.txt")
.
:external-format
: if nil, the system default. Can be bound to :utf-8
.
(filename s)
Write the string s
to the file filename
. If the file does not
exist, create it, if it already exists, replace it.
Options:
:if-does-not-exist
: :create
(default), :error
:if-exists
: :supersede
(default), :append
, :overwrite
, :rename
, :error
,...Returns the string written to file.
Added common-prefix
, 0.5. Not in QL yet.
(list-of-strings)
Find the common prefix between strings.
Example: (str:common-prefix '("foobar" "foozz"))
=> "foo"
Uses the built-in mismatch
, that returns the position at which
the strings fail to match.
Return a string, "" when no results, or nil when the input is the void list.
version 0.6 is available in Quicklisp update of end of january.
(ql:update-dist "quicklisp")
Added:
:omit-nulls
comes after too many parentheses.in 0.8: added string-case
.
in 0.9:
prune
: (str:prune 5 "fooooooo")
=> `"fo..."s-first
, s-rest
, s-nth
suffix
and prefix
functions and predicates: (str:prefix '("foo?" "foobar"))
=> "foo"in 0.10 (upcoming in Quicklisp):
s-last
split
doesn't try to fix cl-ppcre
's inconsistency anymore. When the separator appears at the end, it doesn't return a trailing ""
. See #18.
This issue will serve as an easy changelog to which you can subscribe without subscribing to the whole project or following its commits.
ps: this is an experiment, would appreciate a +1 if you find this useful, thanks.