Bug in string.erl

Robert Virding robert.virding@REDACTED
Thu Nov 13 00:32:35 CET 2003


> > Yes it is defintely a bug. The problem is that I was trying to be nice in the case where the desried substring length is longer than the remaining string inwhich case the substring  just gets the remaining characters. So
> > 
> > string:substr("abcd", 2, 5) -> "cd"
> > 
> > The second should of course be:
> > 
> > substr1(String, L) when list(String) -> []. %Be nice!
> 
> My goodness - I didn't realise you'd written the code - there was a
> comment in it :-)

Ah, I must have been feeling benevolent that day. And if you notice it was too informative. :-)

Robert
 



More information about the erlang-questions mailing list