반응형
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
- Observable
- 문자열
- subscript
- SwiftUI
- Apple
- 라이트모드
- github
- UITabBarController
- gcd
- remote config
- 웹뷰
- Firebase
- RxSwift
- autolayout
- string
- UIScrollView
- SwiftLint
- Realtime Database
- UIButton
- Java
- Android
- NavigationLink
- Alamofire
- Swift
- LazyHStack
- swipe
- 다크모드
- WebView
- ios
- dictionary
Archives
- Today
- Total
목록character (1)
점진적 과부하 개발 블로그

문자열 접근과 수정 문자열 인덱스 각 String값은 문자열에 각 Character의 위치에 해당하는 String.Index인 인덱스 타입을 가지고 있다. Swift 문자열은 정수값으로 인덱스를 생성할 수 없다. 문자열 범위를 벗어나면 런타임 에러가 발생한다. let hello = "Hello" hello[hello.startIndex] // H hello[hello.index(before: hello.endIndex)] // o hello[hello.index(after: hello.startIndex)] // e let index = hello.index(hello.startIndex, offsetBy: 3) hello[index] // l 삽입과 삭제 insert(_:at:) // 하나의 문자를 삽..
Swift/문법
2024. 3. 14. 23:33