Published: 25 Jan 2019 › Updated: 25 Jan 2019![[Grammer] 09 - Boolean, 10 - Strings and Characters](/nhc-explorer-cover.webp)
![[Grammer] 09 - Boolean, 10 - Strings and Characters](/nhc-explorer-cover.webp)
[Grammer] 09 - Boolean, 10 - Strings and Characters
- Boolean: 참/거짓을 구분.
Swift에서는 true, false 2가지만 소문자로 존재.
if 조건문이나 while 반복문에 자주 사용
import UIKit
let valid: true
let invalid = false
let hasName: Bool = true
let isMember: Bool = false
- Strings : 문자열. " " 큰따옴표 사이에 표현. (ex: "Daniel", "123", "true", "", " ")
- Characters: 문자를 표현. 자료형을 직접 지정하지 않는다면 모두 String으로 지정됨.
let char: Character = "c"
let str: String = "MyNameIsGeonhwi"Leave [Grammer] 09 - Boolean, 10 - Strings and Characters to:
Read more #swift4 posts
Best Posts From gunw
We have not curated any of gunw's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From gunw
- [Grammer] 26 - Custom Operators
- [Grammer] 25 - Operator Methods
- [Grammer] 23 - Bitwise Operators, 24 - Identity Operator
- [Grammer]21 - Ternary Coditional Operator, 22 - Range Operators
- [Grammer] 19 - Short-circuit Evaluation, Side Effect, 20 - Assignment Operators
- [Grammer] 16 - Overflow Operators, 17 - Comparison Operators, 18 - Logical Operators
- [Grammer] 13 - Data Types with Memory, 14 - Operator Basics, 15 - Arithmetic Operators
- [Grammer] 11 - Type Inference, Type Safety, 12 - Type Conversion, Type Aliases
- [Grammer] 09 - Boolean, 10 - Strings and Characters
- [Grammer] 07 - Naming Convention, 08 - Numbers