largest-common-prefix

swank.util.string

  • (largest-common-prefix a b)
Returns the largest common prefix of two strings.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source swank/util/string.clj:3 top

(defn largest-common-prefix
  "Returns the largest common prefix of two strings."
  ([#^String a, #^String b]
     (apply str (take-while (comp not nil?) (map #(when (= %1 %2) %1) a b))))
  {:tag String})
Vars in swank.util.string/largest-common-prefix: = apply comp defn map nil? not str take-while when
Used in 0 other vars

Comments top

No comments for largest-common-prefix. Log in to add a comment.