Slice is a variable-length sequence which stores elements of a similar type, you are not allowed to store different type of elements in the same slice. It is just like an array having an index value and length, but the size of the slice is resized they are not in fixed-size just like an array. Internally, slice and an array are connected with each other, a slice is a reference to an underlying array. It is allowed to store duplicate elements in the slice. The first index position in a slice is always 0 and the last one will be (length of slice – 1).
Multi-dimensional slice is just like the multidimensional array, except that slice does not contain the size.
Slice 1 : [[1 2] [3 4] [5 6] [7 8]] Slice 2 : [[str1 str2] [str3 str4] [str5 str6]] MultiDimensional Slice s2: [str1 str2] [str3 str4] [str5 str6] Slice s2 Like Matrix: str1 str2 str3 str4 str5 str6
- How to copy one slice into another slice in Golang?
- Multi-dimensional lists in Python
- How to find the capacity of Channel, Pointer and Slice in Golang?
- How to find the Length of Channel, Pointer, Slice, String and Map in Golang?
- How to Get First and Last Element of Slice in Golang?
- How to Compare Equality of Struct, Slice and Map in Golang?
- How to convert a slice of bytes in uppercase in Golang?
- How to convert a slice of bytes in lowercase in Golang?
- Check if the given slice is sorted in Golang
- Searching an element of float64 type in Golang slice
- How to pass a Slice to Function in Golang?
- How to Sort a Slice of Strings in Golang?
- Check if the specified element is present in the slice of bytes in Golang
- How to count specific characters present in the slice in Golang?
- How to sort a slice of ints in Golang?
- How to sort a slice of float64s in Golang?
- Checking Slice of bytes for equality under Unicode case folding in Golang
- Check if the Slice of bytes starts with specified prefix in Golang
- Check if the Slice of bytes ends with specified suffix in Golang
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.