일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- 리액트입문
- 12회차
- 개인앱
- 회고
- 수정중
- 알고리즘
- 스유
- ViewBuilder
- ios
- iOS개발
- Swift
- 글또
- RxSwift
- 왕초보
- UIKit
- 개발회고
- Postman
- Swift알고리즘
- github
- JavaScript
- 클린코드
- 초보iOS개발자
- SwiftUI
- 글또x코드트리
- 유데미
- 글또10기
- 비동기
- 글쓰기
- 글또9기
- git
- Today
- Total
playground_avec coding
[Swift ] Escape Sequence - 문자열처리 본문
Extended String Delimiters
You can place a string literal within extended delimiters to include special characters in a string without invoking their effect. You place your string within quotation marks (") and surround that with number signs (#). For example, printing the string literal #"Line 1\nLine 2"# prints the line feed escape sequence (\n) rather than printing the string across two lines.
If you need the special effects of a character in a string literal, match the number of number signs within the string following the escape character (\). For example, if your string is #"Line 1\nLine 2"# and you want to break the line, you can use #"Line 1\#nLine 2"# instead. Similarly, ###"Line1\###nLine2"### also breaks the line.
String literals created using extended delimiters can also be multiline string literals. You can use extended delimiters to include the text """ in a multiline string, overriding the default behavior that ends the literal. For example:
- let threeMoreDoubleQuotationMarks = #"""
- Here are three more double quotes: """
- """#
let threeMoreDoubleQuotationMarks = #"""
Here are three more double quotes: """
"""#
'Apple > Swift' 카테고리의 다른 글
[ 이메일 유효성 체크 ] - 이메일 가입이 아무거나 다된다고? (1) (0) | 2024.08.07 |
---|---|
동시성(Concurrency)을 대하는 Swift 의 자세 1 - DispatchQueue (0) | 2024.02.02 |
Swift 기본 가이드라인 - part 1 (0) | 2023.12.14 |
Macro 에 대해서 알아보자. (0) | 2023.11.12 |
[ 구조체와 클래스 ] (0) | 2022.12.02 |