How to realize slicing output
This article mainly explains "how to achieve slice input". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to achieve slice loss".
First of all, the slice content constructed by s [low: high: max] is the same as that of s [low: high], except that there is a difference in capacity, which will be discussed later. In addition, this format only applies to arrays and slices, not strings. Please pay attention to this point!
Secondly, the capacities of s [low: high: max] and s [low: high] are different. The capacity of s [low: high] is cap (s)-low, while the capacity of s [low: high: max] is max-low.
Finally, the range of the index in s [low: high: max] is 0