GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - expez/superstring: Clojure and Clojurescript string library

BranchesTags
Open more actions menu

Latest commit

 

History

184 Commits
184 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
scripts
scripts
 
 
src/superstring
src/superstring
 
 
test/superstring
test/superstring
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
deps.edn
deps.edn
 
 
project.clj
project.clj
 
 

Repository files navigation

superstring CircleCI

Installation

Add the following dependency to your project.clj file:

[superstring "3.2.1"]

Documentation

API Docs

Raison d'être

This is a convenience library. There's nothing in here that you haven't written at least once before, but your time is valuable and you shouldn't have to do it again.

It's also annoying to pull in $library as well as clojure.string to get complete coverage. Or pull in $library where the functions in clojure.string are renamed, or re-implemented with slightly different semantics. I've opted to alias all the vars in clojure.string so you only need to require a single namespace and because I know you hate surprises.

A ton of functions, either on String, or elsewhere, return true as the truthy value. In a lisp this is a terrible waste. To afford string punning this library returns s as the truthy value so you can do stuff like this:

(require '[superstring.core :as str])

(some-> linkedIn-profile
        (str/includes? "developer" :ignore-case)
        (str/includes-all? ["java" "xml"] :ignore-case)
        (str/includes-any? ["ninja" "rockstar"] :ignore-case)
        extract-contact-info
        send-unsolicited-job-offer!)

Quirks

The character ß is a lower case, german, character that is shorthand for ss. This character is, to my knowledge, exceptional in that it upper cases to a combination of two characters. Frankly, this annoying character should be deprecated, but in the meanwhile we should try to treat it in a consistent manner.

The jvm has the following behavior:

(Character/toUppercase \ß) ;;=> \ß
(.toUppercase "ß") ;;=> "SS"
(.equalsIgnoreCase "ß" "ss") ;;=> false

I'm interpreting this to mean:

  1. String comparisons ignoring case should not treat ß and ss or SS as equal.
  2. Any string operations which change the case should consider SS to be the upper case variant of ß.

Is it any good?

Yes!

License

Copyright © 2023 Lars Andersen

This project is licensed under the Eclipse Public License 1.0.

About

Clojure and Clojurescript string library

Resources

Readme
EPL-1.0 license
Activity

Stars

209 stars

Watchers

5 watching

Forks

10 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.