   Returns nil if index falls outside the string boundaries or if
   length is negative."
   ([^String s index]
+   {:pre [(string? s) (integer? index)]
+    :post [(or (string? %) (nil? %))]}
    (slice s index 1))
   ([^String s ^long index length]
+   {:pre [(string? s) (integer? index) (integer? length)]
+    :post [(or (string? %) (nil? %))]}
    (cond
      (neg? length) nil
      (neg? (+ (superstring.core/length s) index))

  If separator is not provided chomp will remove \\n, \\r or \\r\\n from
  the end of s."
  ([^String s]
   (cond
     (.endsWith s "\r\n") (substring s 0 (- (length s) 2))
     (.endsWith s "\r") (substring s 0 (dec (length s)))
     (.endsWith s "\n") (substring s 0 (dec (length s)))
     :else s))
  ([^String s ^String separator]
   (if (.endsWith s separator)
     (substring s 0 (- (length s) (length separator)))
     s)))

(defn ^String contains-any?
  "Return s if s contains any of the needles."
  ([^String s needles]
   {:pre [(string? s) (every? string? needles)]
    :post [(or (string? %) (nil? %))]}
   (some (partial case-sensitive-contains s) needles))
  ([^String s needles ignore-case]
   {:pre [(string? s) (every? string? needles)]
    :post [(or (string? %) (nil? %))]}
   (if ignore-case
     (some (partial case-insensitive-contains s) needles)
     (contains-any? s needles))))
