부분 문자열
| 항목 | 값 |
|---|---|
| 화면 이름 | Substring |
| 식별자 | substringV1 |
| 지원 실행 방식 | Batch, Faster, Streaming |
| 범주 | 숫자 (Numeric) |
| 반환 자료형 | String |
문자열에서 부분 문자열을 추출합니다.
입력 인자
| 이름 | 지정 여부 | 자료형 | 의미와 조건 |
|---|---|---|---|
Expression | 필수 | Expression<String> | 부분 문자열을 추출할 표현식입니다. |
Start | 필수 | Expression<Integer> | 추출을 시작할 인덱스이며 해당 위치를 포함합니다. 1부터 세고 음수는 문자열 끝에서 셉니다. |
Length | 선택 | Expression<Integer> | 추출할 문자열 길이입니다. 생략하면 나머지 문자열 전체를 추출합니다. |
입출력 예시
예시 1: 기본 동작
인자 값:
Expression:stringStart:startLength:length
| string | start | length | 출력 |
|---|---|---|---|
| hello, world | 1 | 5 | hello |
| hello, world | 8 | 5 | world |
| hello, world | -5 | 5 | world |
예시 2: 기본 동작
길이를 지정하지 않으면 문자열 끝까지 추출합니다.
인자 값:
Expression:stringStart:startLength: null
| string | start | 출력 |
|---|---|---|
| hello, world | 1 | hello, world |
| hello, world | 8 | world |
| hello, world | -5 | world |
예시 3: null 처리
null 입력에서는 결과가 null입니다.
인자 값:
Expression:stringStart:startLength:length
| string | start | length | 출력 |
|---|---|---|---|
| null | 1 | 5 | null |
| hello, world | null | 5 | null |
| hello, world | 1 | null | null |
| null | null | null | null |
예시 4: 경계 조건
요청한 길이가 남은 문자열보다 길면 끝까지 반환합니다.
인자 값:
Expression:stringStart:startLength:length
| string | start | length | 출력 |
|---|---|---|---|
| hello, world | -5 | 10 | world |
| hello, world | 1 | 20 | hello, world |
| hello, world | 12 | 5 | d |
| hello, world | 13 | 5 | empty string |
| hello, world | 20 | 5 | empty string |
| hello, world | 12 | -5 | empty string |