vindarel / cl-str

Modern, simple and consistent Common Lisp string manipulation library.
https://vindarel.github.io/cl-str/
MIT License
309 stars 37 forks source link

CHANGELOG #9

Closed vindarel closed 5 years ago

vindarel commented 6 years ago

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.

vindarel commented 6 years ago

added in 0.4, january 8th 2018, waiting for Quicklisp release.

from-file (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.

to-file (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:

Returns the string written to file.

vindarel commented 6 years ago

Added common-prefix, 0.5. Not in QL yet.

common-prefix (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.

vindarel commented 6 years ago

version 0.6 is available in Quicklisp update of end of january.

(ql:update-dist "quicklisp")

Added:

vindarel commented 6 years ago

in 0.8: added string-case.

in 0.9:

in 0.10 (upcoming in Quicklisp):