Siebel eScript Language Reference > Methods Reference > Array Methods >

Get Subarray Method


The Get Subarray method gets the array elements that exist in a range starting with the value that the first element argument identifies and ending with the value that the last element argument identifies. It returns a new array.

Format

slice (first element, last element)

Table 31 describes the arguments for the Get Subarray method.

Table 31. Arguments for the Get Subarray Method
Argument
Description

first element

The first element that this method returns.

last element

The last element minus one that this method returns.

Example

The following example includes the Get Subarray method:

var v = new Array;
var u;
v[0] = 7;
v[1] = 3;
v[2] = 4;
v[3] = 5;
u = v.slice ( 1, 3); // u creates new array containing v[1] and v[2] values. For example, u[0] = 3, u[1] = 4.
v.shift(); // Now v[0] is 3, v[1] is 4

Siebel eScript Language Reference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.