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
- 중첩함수
- ios
- replacingOccurrences
- 나를부르는숲
- textinput
- 17681
- ReactNative
- 비반환함수
- 함수형프로그래밍
- next.js
- 프로그래머스
- 72410
- 동적언어
- multiline
- SWIFT
- JavaScript
- 옵셔널
- beforePopState
- 데이터타입함수
- DelayInput
- 스위프트
- lineending
- reactnavigation
- Server-Side-Rendering
- reactnative android
- switch구문
- 리액트네이티브
- 약타입
- client-side-rendering
- 약타입언어
Archives
- Today
- Total
목록replacingOccurrences (1)
으니의 개발로그
[Swift] 문자열에서 특정 문자 제거하거나 치환하기
[Swift] 문자열에서 특정 문자 제거하거나 치환하기 python에서는 문자열에서 특정 문자를 제거하거나 치환하기 위해서 replace 함수를 사용하면 된다. name = "seonho" print(name.replace("e", "")) # sonho print(name.replace("e", "a")) # saonho swift 에서도 이런 함수가 있는지 확인하기 위해 찾아보니 다행히 있었다! replacingOccurrences(of:with:) of 에는 바꾸고 싶은 문자, with 에는 바꿀 문자를 적어주면 된다. let name: String = "seonho" let change1: String = name.replacingOccurrences(of: "e", with: "") let ch..
Swift/with. APS
2021. 2. 10. 19:30