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
- 프로그래머스 n번째 원소까지
- 프로그래머스 n의 배수 고르기
- Error installing cocoapods
- 프로그래머스 주사위 게임1
- Break
- Til
- 배열 만들기1
- 객체지향
- 프로그래머스 문자열 붙여서 출력하기
- 스파르타코딩캠프
- 주사위 게임1
- 스파르타 코딩클럽 내일배움캠프
- 문자열 정렬하기 (1)
- 스페인어
- array
- 프로그래머스 최댓값 만들기(2)
- n번째 원소까지
- cocoapods 설치 오류
- 문자열 붙여서 출력하기
- 프로그래머스 암호 해독
- 조건에 맞게 수열 변경하기 3
- 프로그래머스
- 연산자
- ruby설치
- 프로그래머스 배열 만들기1
- 프로그래머스 문자열 정렬하기 (1)
- 프로그래머스 조건에 맞게 수열 변경하기 3
- continue
- swift
- 프로그래머스 자동커밋
Archives
- Today
- Total
dev._.note
[Swift] replacingOccurrences(of:with:) 본문
replacingOccurrences(of:with:)
특정 문자열에 해당하는 곳의 문자열 치환
self에서 of 문자열 부분을 with으로 변경
replacingOccurrences(of:with:) | Apple Developer Documentation
Returns a new string in which all occurrences of a target string in the receiver are replaced by another given string.
developer.apple.com
let sampleStr = "12345"
let newStr = sampleStr.replacingOccurrences(of: "2", with: "vv")
print(newStr) // 1vv345
'Dev > SWIFT' 카테고리의 다른 글
[Swift] 통신 시 인터넷 권한 추가 (info.plist 설정) (0) | 2024.02.01 |
---|---|
[Swift] MVC와 MVVM 장점과 단점 (0) | 2024.01.30 |
[Swift-UI] 화면전환하기 (0) | 2024.01.11 |
[Swift] lazy란? (0) | 2024.01.10 |
[Swift] Decodabe, Encodable, Codable (0) | 2024.01.09 |