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 |
Tags
- UITextView
- HIG
- swift documentation
- tableView
- combine
- Clean Code
- Human interface guide
- 리펙터링
- SWIFT
- Protocol
- collectionview
- swiftUI
- map
- uiscrollview
- ribs
- Observable
- 클린 코드
- MVVM
- clean architecture
- 리팩토링
- ios
- UICollectionView
- Refactoring
- 애니메이션
- 스위프트
- Xcode
- rxswift
- RxCocoa
- uitableview
- 리펙토링
Archives
- Today
- Total
목록replacingOccurrences(of: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