1.2.0 permalink Arrow_down_16x16

char-position

swank.util.string

  • (char-position c str)
  • (char-position c str start)
Finds the position of a character within a string, optionally
provide a starting index. Returns nil if none is found.

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:9 top

(defn char-position
  "Finds the position of a character within a string, optionally
   provide a starting index. Returns nil if none is found."
  ([c str] (char-position c str 0))
  ([#^Character c #^String str #^Integer start]
     (let [idx (.indexOf str (int c) start)]
       (when (not= -1 idx)
         idx))))
Vars in swank.util.string/char-position: defn let not= str when
Used in 0 other vars

Comments top

No comments for char-position. Log in to add a comment.