Text Commands

Trim text

텍스트의 시작·끝에 있는 공백 문자(공백·탭·줄바꿈)를 제거합니다.

매개변수

ArgumentTypeDescription
Text to trim텍스트원본 텍스트
What to trim선택공백을 제거할 위치 (아래 옵션 표 참조)

What to trim 옵션

옵션동작
whitespace characters from the beginning앞쪽 공백 제거
whitespace characters from the end뒤쪽 공백 제거
whitespace characters from the beginning and end양쪽 공백 제거

반환값

반환값

성공 시 1, 실패 시 0. 수정된 텍스트는 mReturnString 변수에 저장됩니다.

예제

What to trim 옵션에 따라 앞·뒤·양쪽 공백을 제거합니다. 아래 표에서 는 공백 한 칸을 나타냅니다.

Text to trimWhat to trim결과
(mReturnString)
␣␣hello␣␣beginninghello␣␣
␣␣hello␣␣end␣␣hello
␣␣hello␣␣beginning and endhello

단어 사이의 공백은 제거되지 않고 양 끝 공백만 제거됩니다.

설명

Trim text 작업은 원본 텍스트를 What to trim 매개변수에 따라 잘라내고 결과 텍스트를 생성합니다. 공백 문자에는 공백, 탭, 새 줄(줄바꿈) 이 모두 포함됩니다.

관련 명령어