swift string interpolation (1) 썸네일형 리스트형 071 ~ 086. Strings and Character (문자열과 캐릭터) Strings and Character let s = "string" print(type(of: s)) 결과 String let c = "c" print(type(of: c)) 결과 String 자동 지정 방식의 경우 큰 따옴표 사이의 문자 수와는 상관없이 항상 문자열로 판단한다. 따라서 형식지정 방식을 사용해야 character를 저장할 수 있다. let c: Character = "c" print(type(of: c)) 결과 Character 빈 문자열과 빈 문자를 저장하는 방법도 서로 상이하다. let emptyC: Character = " " var emptyS = " " print(emptyS.count) emptyS = "" print(emptyS.count) 결과 1 0 문자는 공백으로 분 .. 이전 1 다음