Module ddash.algorithm.fill

Assigns value to each element of input range range

Example

int[] a = [1, 2, 3];
a.fill(5);
assert(a == [5, 5, 5]);

int[] b = [1, 2, 3, 4, 5];
b.fill(9, 2, 4);
assert(b == [1, 2, 9, 9, 5]);

int[] c = [1, 2, 3, 4, 5];
c.fill(9, 1, 100);
assert(c == [1, 9, 9, 9, 9]);

Functions

NameDescription
fill(range, value, startIndex, endIndex) Fills a range with a value from startIndex to endIndex