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 |
Tags
- rxswift
- Xcode
- 애니메이션
- 스위프트
- clean architecture
- SWIFT
- tableView
- 리펙토링
- 클린 코드
- uitableview
- UICollectionView
- Protocol
- uiscrollview
- Observable
- UITextView
- collectionview
- combine
- ribs
- MVVM
- ios
- HIG
- swift documentation
- RxCocoa
- Human interface guide
- 리펙터링
- 리팩토링
- swiftUI
- Clean Code
- map
- Refactoring
Archives
- Today
- Total
김종권의 iOS 앱 개발 알아가기
[swift - algorithm] 갯수만큼 특정 문자열 추가, String(repeating:count:) 본문
알고리즘/문자열 처리
[swift - algorithm] 갯수만큼 특정 문자열 추가, String(repeating:count:)
jake-kim 2021. 3. 13. 19:42특정 문자열을 지정한 갯수만큼 추가하고 싶은 경우
- for문을 쓰지 않고 스위프트 내장 함수 사용
- String(repeating:count:)
let strResult = String(repeating: "*", count: 5)
print(strResult) // "*****"
'알고리즘 > 문자열 처리' 카테고리의 다른 글
[swift - algorithm] 문자열 자르기, substring (0) | 2021.03.14 |
---|---|
[swift - algorithm] 문자열 파싱, split(separator:), components(separatedBy:), joined() (0) | 2021.03.13 |
[swift - algorithm] 문자열 치환, replacingOccurrences(of:with:), replacingCharacters(in:with:) (0) | 2021.03.11 |
[swift - algorithm] Date(), 날짜, 시간 (0) | 2020.04.22 |
Comments