Extended String Delimiters

  • #
  • #""Hello World""# = Hello world
  • ํŠน์ˆ˜๋ฌธ์ž๋“ค์„ ๊ทธ๋Œ€๋กœ ํ‘œํ˜„ ๊ฐ€๋Šฅ
  • String literal ์„ ์–ธ์„๋กœ ๊ฐ์Œˆ
  • escape seqence\n์€ ์•„๋ž˜์™€ ๊ฐ™์ด ์‚ฌ์šฉ
  • #"Line1\#nLine2#
    • Line1
    • Line2

Concatenating

  • + ๊ฐ€๋Šฅ

String Interpolation

  • "\(name) ๋Š” \(food)์„ ๋จน์Šต๋‹ˆ๋‹ค"

Unicode

  • String์€ ๋‚ด๋ถ€์ ์œผ๋กœ Unicode scalar value๋ฅผ ์‚ฌ์šฉํ•จ
  • 21-bit number
    let precomposed: Character = "\u{D55C}" // ํ•œ
    let decomposed: Character = "\u{1112}\u{1161}\u{11AB}" // ใ…Ž,ใ…,ใ„ด = ํ•œ์œผ๋กœ ํ‘œํ˜„๋จ

Index

  • String.Index๋กœ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ์Œ
  • ํ•ด๋‹น ํ•จ์ˆ˜๋“ค๋กœ ๋‹ค๋ค„์•ผ ํ•จ. ์ƒ๋‹นํžˆ ๊ท€์ฐฎ์Œ