전체 글 (184) 썸네일형 리스트형 [Day16-4] A 강조하기 문제 내 정답 코드 import Foundation func solution(_ myString:String) -> String { var myString = myString.map { String($0) } for i in 0.. String { return myString.lowercased().replacingOccurrences(of: "a", with: "A") } 배운 기술 1. replacingoccurrences() https://developer.apple.com/documentation/foundation/nsstring/1412937-replacingoccurrences replacingOccurrences(of:with:) | Apple Developer Documentation R.. [Day16-3] 배열에서 문자열 대소문자 변환하기 문제 내 정답 코드 import Foundation func solution(_ strArr:[String]) -> [String] { return strArr.enumerated().map { !$0.offset.isMultiple(of: 2) ? $0.element.uppercased() : $0.element.lowercased() } } # 1. eunmrated로 인덱스를 가져와 홀/짝수를 판별하고 2. 조건에 맞게 대문자 또는 소문자로 반환한다. 배운 기술 [Day16-2] 소문자로 바꾸기 문제 내 정답 코드 import Foundation func solution(_ myString:String) -> String { return myString.lowercased() } # 1. lowercased() 존재를 알 수 있는 문제 배운 기술 이전 1 ··· 33 34 35 36 37 38 39 ··· 62 다음