On Sat, Jun 25, 2016 at 7:54 AM, Alvin Lindstam <[email protected]>
wrote:

> Checking the length of a String requires traversing the whole string. I
> fairly common use case is checking if the String is longer or shorter than
> a given value. I might not be interested if the string is 123 456 graphemes
> long or 654 321, if all I want to know if it is longer than 50 000
> characters, but still has to calculate the full length to know if it is.


What about String.at("bob", 4) != nil would test if "bob" was greater then
or equal to 4 chars in a single pass.

John

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAPhAwGwM0aN_Mx2a-_mwe9qi_UNR91KMDH_BpkskSaXHS-D0%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to