I have created a function to check whether or not my first string ends with a second string.
In Java we have ready made method to check this, but in Clojure I failed to find such a method so I written custom function as follows:
(defn endWithFun [arg1 arg2]
(= (subs arg1 (- (count arg1) (count arg2)) (count arg1)) arg2))
Outputs:
> (endWithFun "swapnil" "nil")
true
> (endWithFun "swapnil" "nilu")
false
This is working as expected.
I want to know, is there a similar alternative? Also in my case, I compare case sensitively. I also want to ignore case sensitivity.