Import std.collections.view
T[]
extend
Extend T[]
Views of every array: part of it, read and set in place, and the whole, to read but not change.
std/collections/view.fb, line 27
-
The elements from
startup tofinish, without the one atfinish, as a view of them in the array. They have to be in the array.Examples
Local numbers = [1, 2, 3, 4, 5] Local middle = numbers.View(1, 4) middle[0] = 20 Expect(numbers == [1, 20, 3, 4, 5]) Expect(middle.Count == 3 && middle.ToArray() == [20, 3, 4]) -
The array, to read but not change.
Examples
Local scores = [1, 2, 3] Local shown = scores.AsReadOnly() scores.Add(4) Expect(shown.Count == 4 && shown[3] == 4)
Report an issue with this page or with FutureBlitz on GitHub.