(last-index-of s value)
(last-index-of s value from-index)
Return last index of value (string or char) in s, optionally
searching backward from from-index. Return nil if value not found.
Source
(defn last-index-of
"Return last index of value (string or char) in s, optionally
searching backward from from-index. Return nil if value not found."
{:added "1.8"}
([^CharSequence s value]
(let [result ^long
(if (instance? Character value)
(.lastIndexOf (.toString s) ^int (.charValue ^Character value))
(.lastIndexOf (.toString s) ^String value))]
(if (= result -1)
nil
result)))
([^CharSequence s value ^long from-index]
(let [result ^long
(if (instance? Character value)
(.lastIndexOf (.toString s) ^int (.charValue ^Character value) (unchecked-int from-index))
(.lastIndexOf (.toString s) ^String value (unchecked-int from-index)))]
(if (= result -1)
nil
result))))