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
- collectionview
- Human interface guide
- RxCocoa
- ribs
- 애니메이션
- 클린 코드
- HIG
- Protocol
- uiscrollview
- 리펙터링
- MVVM
- swift documentation
- rxswift
- 리펙토링
- Observable
- uitableview
- swiftUI
- SWIFT
- 리팩토링
- Refactoring
- combine
- UICollectionView
- ios
- map
- clean architecture
- 스위프트
- tableView
- Clean Code
- Xcode
- UITextView
Archives
- Today
- Total
목록replacingCharacters(in:with) (1)
김종권의 iOS 앱 개발 알아가기
[swift - algorithm] 문자열 치환, replacingOccurrences(of:with:), replacingCharacters(in:with:)
특정 문자열에 해당하는 곳의 문자열 치환 replacingOccurrences(of:with:) 이용: self에서 of 문자열 부분을 with으로 변경 let sampleStr = "12345" let newStr = sampleStr.replacingOccurrences(of: "2", with: "vv") print(newStr) // 1vv345 Range값을 이용한 문자열 치환 replacingCharacters(in:with:) 이용: self에서 in 범위 부분을 with으로 변경 NSRange 개념: location, length 정보 가지고 있는 구조체 Range 개념: lowerBound, upperBound정보를 가지고 있는 구조체 range값을 가지고 문자열을 치환하는 예제) - t..
알고리즘/문자열 처리
2021. 3. 11. 02:42