To print a list including square brackets we just use the simple print method.
Example:
void main[]{ var myList = [1, 2, 3, 4, 5]; print[myList]; }Output:
[1, 2, 3, 4, 5]If you do not want to print the square brackets means you just want to print the contents of the list, here is the solution