Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

배열 구간 추출

항목값
화면 이름Slice array
식별자arraySliceV1
지원 실행 방식Batch, Faster, Streaming
범주배열 (Array)
반환 자료형Array<T>

시작 위치와 길이로 배열 구간을 추출합니다. 양수 위치는 1부터 세고 음수는 끝에서 셉니다. 시작 위치 0은 허용하지 않습니다. 길이가 배열 끝을 넘으면 나머지 원소 전체를 반환합니다.

입력 인자

이름지정 여부자료형의미와 조건
Expression필수Expression<Array<T>>구간을 추출할 배열입니다.
Slice begins필수Expression<Integer>시작 인덱스는 1부터 세며 음수는 배열 끝에서 셉니다. 0은 허용하지 않습니다.
Slice length필수Expression<Integer>추출할 구간의 길이입니다. 배열 끝을 넘으면 남은 원소 전체를 반환합니다.

자료형 변수의 범위

  • T는 AnyType 범위의 자료형을 받습니다.

입출력 예시

예시 1: 기본 동작

인자 값:

  • Expression: array
  • Slice begins: sliceBegins
  • Slice length: sliceLength
arraysliceBeginssliceLength출력
[ hello, world, out, there ]12[ hello, world ]
[ hello, world, out, there ]22[ world, out ]
[ hello, world, out, there ]10[ ]
[ hello, world, out, there ]210[ world, out, there ]
[ hello, world, out, there ]-12[ there ]

예시 2: null 처리

인자 값:

  • Expression: array
  • Slice begins: sliceBegins
  • Slice length: sliceLength
arraysliceBeginssliceLength출력
[ hello, world, out, there ]01null
[ hello, world, out, there ]00null
[ hello, world, out, there ]1-1null
[ ]12[ ]
[ null, null ]11[ null ]