On 2012-12-29 23:55, FG wrote:
Probably because I like concise code. I always prefer:
     if (A) print(getMessage().getSlice(0..100));

to writing something like this:
     auto message = getMessage();
     if (A) print(message.length > 100 ? message[0..100] : message);


Actually, when I look at this, it can be a one-liner after all. :)

    if (A) print(getMessage()[0..($>100?100:$)]);

Didn't expect this to work.

Reply via email to