SWIFT
옵셔널 in 스위프트(Optional values in Swift)
스위프트의 가장 다른 코드중의 하나는 Optional values 이다. 일반적인 코드는 아래와 같다.var str2:String = "Example" str2.replacingOccurrences(of: "Ex", with: "S") 결과"Example""Sample" var str2:String? = "Example" str2?.replacingOccurrences(of: "Ex", with: "S") 결과 "Example" "Sample" 여기서 ?는 nil 또는 null이 될수 있다는 것이다. var str3:String? = nil str3?.replacingOccurrences(of: "Ex", with: "S") 결과 nil nil nil이더라도 결과 값이 에러가 나지 않는다는 것이다. (i..