setting size of string array sets any existing elements to null

so the following;

01 di-val string occurs any.

set size of di-val to 1.
move "123" to di-val(1)
set size of di-val to 2.
move "ac" to di-val(2)

When "set size of di-val to 2" is executed, di-val(1) is set to null (ie. all elements in the array are set to null)

Is there any way around this or an alternative approach. I basically want an array that can contain strings of varying lengths without taking up too much memory.