Superstring interactive documentation

Setup

First let's load superstring from the superstring github repository (It might take a couple of seconds...):

(ns my.str (:require [superstring.core :as str]))

slice

slice returns a slice of s beginning at index and of the given length, or 1. If index is negative the starting index is relative to the end of the string. If the requested slice ends outside the string boundaries, we return the substring of s starting at index. Returns nil if index falls outside the string boundaries or if length is negative.
(str/slice "0123456789" 2 5)

(str/slice "0123456789" 2 1)

(str/slice "0123456789" -3 2)

swap-case

swap-case changes lower case characters to upper case and vice versa.
(str/swap-case "AbCdEFgh")

includes?

(str/includes? "Developer" "developer" :ignore-case)

(str/includes? "Developer" "developer")

includes-all?

(str/includes-all? "Java and XML and Clojure" ["java" "xml"] :ignore-case)

(str/includes-all? "Java and XML and Clojure" ["java" "xml"])

includes-any?

(str/includes-any? "Java and Clojure" ["java" "xml"] :ignore-case)

(str/includes-any? "Java and XML and Clojure" ["java" "xml"])