On Mon, 09 Aug 2010 18:58:36 +0200, simendsjo wrote: > The documentation says > /******************************************* > * Returns s[] sans trailing delimiter[], if any. * If delimiter[] is > null, removes trailing CR, LF, or CRLF, if any. */ > > To adhere to the documentation, chomp must be changed from: > > C[] chomp(C, C1)(C[] s, in C1[] delimiter) { > if (endsWith(s, delimiter)) > { > return s[0 .. $ - delimiter.length]; > } > return s; > } > > to: > > C[] chomp(C, C1)(C[] s, in C1[] delimiter) { > if (delimiter == null) > return chomp(s); > else if (endsWith(s, delimiter)) > return s[0 .. $ - delimiter.length]; > else > return s; > }
Either that, or the documentation for it needs to be changed. Anyway, it would be great if you'd report this. http://d.puremagic.com/issues/ Thanks! -Lars