Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

printf 방식 문자열 서식

항목값
화면 이름Format string
식별자formatStringV1
지원 실행 방식Batch, Streaming
범주문자열 (String)
반환 자료형String

printf 방식으로 문자열 서식을 지정합니다.

입력 인자

이름지정 여부자료형의미와 조건
Format arguments필수List<Expression<Boolean | Byte | Date | Decimal | Double | Float | Integer | Long | Short | String | Timestamp>>서식 문자열에 삽입할 인자 목록입니다.
Format string필수Literal<String>서식 지정할 문자열입니다.

입출력 예시

예시 1: 기본 동작

인자 값:

  • Format arguments: [argument1, argument2]
  • Format string: Hello %s, my name is %s
argument1argument2출력
AliceBobHello Alice, my name is Bob
JaneJohnHello Jane, my name is John

예시 2: 기본 동작

정수 서식을 적용합니다.

인자 값:

  • Format arguments: [4]
  • Format string: number = %d

출력: number = 4

예시 3: 기본 동작

Double에 부호와 소수 네 자릿수의 서식을 적용합니다.

인자 값:

  • Format arguments: [2.718281828459045]
  • Format string: e = %+.4f

출력: e = +2.7183

예시 4: null 처리

인자 값:

  • Format arguments: [argument1, argument2]
  • Format string: Hello %s, my name is %s
argument1argument2출력
nullBobHello null, my name is Bob
AlicenullHello Alice, my name is null
nullnullHello null, my name is null