Definition and usage
The Array_slice () function takes a value out of the array and returns it as a condition.
Note: If the array has a string key, the returned array retains the key name. (see Example 4)
Grammar
Array_slice (Array,offset,length,preserve)
Parameters
Array
Necessary. Specifies the input array.
Offset
Necessary. Numerical. Specifies the starting position of the element to be removed. If it is a positive number, start with the previous one, and if it is negative, take the offset from the back to the absolute value.
Length
Optional. Numerical. Specifies the length of the returned array. If length is positive, the number of elements is returned. If length is negative, the sequence terminates so far away from the end of the array. If omitted, the sequence starts with offset until the end of the array.
Preserve
Optional. Possible values:
True-reserved Key
False-Default-reset key
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service