[프로그래머스 LV0] 특정 문자 제거하기

jonghwan·2022년 10월 24일
0

프로그래머스

목록 보기
38/71
post-thumbnail

1. 문제 설명

특정 문자 제거하기

2. 문제 분석

components 메서드를 활용해서 특정 문자를 제거 해준 다음 joined 메서드를 활용해 String을 합쳐준다.

3. 나의 풀이

import Foundation

func solution(_ my_string:String, _ letter:String) -> String { my_string.components(separatedBy: letter).joined() }

0개의 댓글