
In this guide, we will discuss Updating the Index in Dart Programming Language. Dart allows modifying the value of an item in a List. In other words, one can re-write the value of list item. The following example illustrates the same −
void main() { List l = [1, 2, 3]; l[0] = 123; print(l); }
The above example updates the value of the List item with index 0. The output of the code will be −
[123, 2, 3]
Next Topic : Click Here
Pingback: Dart Programming - Updating a list | Adglob Infosystem Pvt Ltd
Pingback: Dart Programming - Lists (Basic Operations) | Adglob Infosystem Pvt Ltd