www.digitalmars.com         C & C++   DMDScript  

D - Help with Code

A few posts earlier I proposed a new Split function for the std.string

The code was the first I've written in D, and I was wondering if someone
could have a look and tell me:
    a.    if I should have duplicated the strings into the words array,
    b.    if the syntax for allocating the words array is correct (I find it
a bit funny that the allocation is char[][x] while access is words[x] = ...
    c.    could I have just assigned a new length to words rather than using
'new char[][parts]'
    d.    what is the effect of setting the length to what it currently is -
is it ignored

Any advice/thjoughts would be appreciated.


Apr 16 2004