replace
- 공백 제거 및 특정 문자열 반환
var str = "hello world"
println(str.replace(" ","")) //helloworld
println(str.replace("world","hi")) //hellohi'Kotlin > 문법' 카테고리의 다른 글
| Kotlin - StringBuilder() (0) | 2024.02.05 |
|---|---|
| Kotlin - List vs Array (0) | 2024.02.05 |
| Kotlin - List 추출하기 (0) | 2024.02.04 |
| Kotlin - 배열 (0) | 2024.02.03 |
| Kotlin - contains() (0) | 2024.02.02 |