반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- PostgreSQL
- Tkinter
- SQL
- Kotlin
- 파이썬
- Github
- c#
- matplotlib
- Python
- Redshift
- Presto
- list
- array
- django
- numpy
- google apps script
- math
- hive
- GIT
- dataframe
- Google Spreadsheet
- string
- gas
- Google Excel
- Apache
- Java
- Excel
- PySpark
- PANDAS
Archives
- Today
- Total
달나라 노트
Google Apps Script : trim (문자 양쪽의 공백 제거) 본문
728x90
반응형
String 객체의 trim method는 문자 양쪽의 공백을 제거합니다.
Syntax
String.trim()
trim method는 String에 적용할 수 있으며 parameter는 없습니다.
function myFunction(){
var test_string = ' App le ';
Logger.log(test_string.trim());
}
-- Result
App le
test_string을 보면 문자 양쪽에 공백이 있습니다.
여기에 trim을 적용한 결과를 보면 App le 가 출력되었습니다.
즉, String 양쪽에 있던 모든 공백이 사라진 것입니다.
다만 문자열 사이에 있는 공백은 제거되지 않습니다.
728x90
반응형
'Google Apps Script' 카테고리의 다른 글
| Google Apps Script : repeat (문자열 반복하기) (0) | 2022.12.01 |
|---|---|
| Google Apps Script : padStart, padEnd (왼쪽에 문자 붙이기, 오른쪽에 문자 붙이기, 양쪽에 문자 붙이기) (0) | 2022.12.01 |
| Google Apps Script : replace (문자 대체하기, 문자 변경하기) (0) | 2022.12.01 |
| Google Apps Script : match, search, 정규표현식 (문자열 찾기, 문자열 위치 찾기, 정규표현, regular expression) (0) | 2022.12.01 |
| Google Apps Script : indexOf (특정 문자의 위치 찾기) (0) | 2022.12.01 |
Comments