www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.range.chunks for char[]

reply "cal" <callumenator gmail.com> writes:
Is there an equivalent to std.range.chunks that will work on a 
char array? As in, it will return a range iterating over chunks 
of code points?
Oct 17 2012
parent "Jonathan M Davis" <jmdavisProg gmx.com> writes:
On Thursday, October 18, 2012 01:19:02 cal wrote:
 Is there an equivalent to std.range.chunks that will work on a
 char array? As in, it will return a range iterating over chunks
 of code points?

Not that I'm aware of (though there _may_ be a function that you could do it with that I'm not thinking of), but such a function would be an order of magnitude worse than chunks, because it would have to actually walk the string to determine where to slice it. Writing it would be fairly trivial though. - Jonathan M Davis
Oct 17 2012