JuliaLang/julia — pull request #1041 by JeffreySarnoff (2012-07-12 09:45:46+00:00)
Title: rewrote ends_with (base/string.jl) runs 10x faster on my machine

Following Stefan's dev note, I use str[ thisind(str,end) .. ] to index the final character of the string.
I chose length(str) when testing for a non-empty string, and strlen(str) when counting characters.
Without understanding why, I followed the order used in string.jl,
placing ends_with(String,String) before ends_with(String,Char).
I left intact the comment # TODO: better ends_with