expected array behaviour

Jarrett Billingsley jarrett.billingsley at gmail.com
Thu Jan 1 16:30:24 PST 2009


On Thu, Jan 1, 2009 at 7:10 PM, Mike James <foo at bar.com> wrote:
> Got it - so I should do this...
>
> const char[] array1= "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> char[]  array2 = new char[array1.length];

Just "char[] array2 = array1.dup;"

.dup duplicates the array by creating a new array the same length and
copying the data over.


More information about the Digitalmars-d-learn mailing list