일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- gas
- Google Spreadsheet
- numpy
- Java
- Mac
- Python
- Excel
- Tkinter
- hive
- c#
- math
- PySpark
- SQL
- Redshift
- 파이썬
- PANDAS
- Kotlin
- google apps script
- matplotlib
- dataframe
- Github
- array
- PostgreSQL
- django
- Google Excel
- list
- Apache
- GIT
- string
- Today
- Total
목록Replace (4)
달나라 노트
String 객체의 replace method는 특정 문자나 패턴을 찾아서 원하는 문자로 바꿔주는 기능을 합니다. Syntax String.replace(old_text, new_text) replace method는 String에 적용할 수 있으며 2개의 parameter를 받습니다. - old_text String에서 찾을 기존 text입니다. 여기는 text 대신 regular expression도 들어갈 수 있습니다. - new_text 새로 변경할 텍스트입니다. function myFunction(){ var test_string = 'Apple'; Logger.log(test_string.replace('ppl', 'abc')); Logger.log(test_string.replace(/[a-..
replace(), replaceAll() method는 둘 다 문자열에서 특정 텍스트를 어떠한 다른 텍스트로 바꿔줍니다. Syntax string.replace(text_before, text_after) string.replaceAll(text_before, text_after) 일반적인 replace() method사용법과 비슷합니다. string에 적용할 수 있으며 2개의 인자를 받습니다. text_before = string에서 찾아낼 text text_after = 새롭게 대체할 text replace()와 replaceAll()의 차이는 다음과 같습니다. replace()는 string에서 text_before를 찾고 가장 처음 찾아진 text만을 text_after로 바꿉니다. 즉, str..
replace method를 이용하면 어떤 문자열에서 특정 문자를 내가 원하는 다른 문자로 변경할 수 있습니다. replace의 syntax는 아래와 같습니다. text.replace(old_text, new_text, replace_count) text.replace = text에 replace를 적용합니다. old_text = text 속에서 바꿀 대상 문자열입니다. new_text = old_text를 지우고 그 자리에 새로 대체할 text입니다. replace_count = text에 old_text와 매칭되는 부분이 여러 개 있을 수 있는데 이 중 몇개를 replace할지에 대한 숫자를 적으면 됩니다. 만약 이 값을 적지 않으면 old_text와 매칭되는 모든 문자가 new_text로 변경됩니다..