ee.List.slice
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הפונקציה מחזירה חלק מהרשימה בין אינדקס ההתחלה (כולל) לבין אינדקס הסיום (לא כולל). ערכים שליליים של start או end סופרים לאחור מסוף הרשימה. ערכים שגדולים מגודל הרשימה הם חוקיים, אבל הם נחתכים לגודל הרשימה.
שימוש | החזרות |
---|
List.slice(start, end, step) | רשימה |
ארגומנט | סוג | פרטים |
---|
זה: list | רשימה | |
start | מספר שלם | |
end | מספר שלם, ברירת מחדל: null | |
step | מספר שלם, ברירת מחדל: null | |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003eThis method returns a portion of a list, starting from the \u003ccode\u003estart\u003c/code\u003e index and ending before the \u003ccode\u003eend\u003c/code\u003e index.\u003c/p\u003e\n"],["\u003cp\u003eNegative indices for \u003ccode\u003estart\u003c/code\u003e or \u003ccode\u003eend\u003c/code\u003e are calculated from the end of the list.\u003c/p\u003e\n"],["\u003cp\u003eIf \u003ccode\u003estart\u003c/code\u003e or \u003ccode\u003eend\u003c/code\u003e values exceed the list's size, they are adjusted to the list's boundaries.\u003c/p\u003e\n"],["\u003cp\u003eThe optional \u003ccode\u003estep\u003c/code\u003e argument can be used to select elements at specific intervals, with a default of null implying a step of 1.\u003c/p\u003e\n"]]],["The `List.slice` function extracts a sublist from a given list. It takes `start` and `end` indices (inclusive and exclusive, respectively) and an optional `step`. Negative indices count backward from the end. Out-of-bounds indices are adjusted to the list's boundaries. The function returns a new List. `end` and `step` default to null if not specified.\n"],null,["# ee.List.slice\n\nReturns a portion of list between the start index, inclusive, and end index, exclusive. Negative values for start or end count backwards from the end of the list. Values greater than the size of the list are legal but are truncated to the size of list.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------|---------|\n| List.slice`(start, `*end* `, `*step*`)` | List |\n\n| Argument | Type | Details |\n|--------------|------------------------|---------|\n| this: `list` | List | |\n| `start` | Integer | |\n| `end` | Integer, default: null | |\n| `step` | Integer, default: null | |"]]