Andrej Mitrovic: > In the meantime I guess I'll use this monster: > > array(until!(not!isWhite)(line)).length This is better: import std.algorithm, std.range, std.ascii, std.functional; void main() { string line = " foo "; size_t n = walkLength(until!(not!isWhite)(line)); assert(n == 3); } Bye, bearophile