LoginSignup
1
1

More than 5 years have passed since last update.

Swiftに文字列定数連結がない理由を考えてみた

Posted at

C言語と似通った構文であるにもかかわらずSwiftでは文字列定数連結がありません。

    char *str = "hoge"
                "hage";

こういうやつね。

    let str: String = "hoge"
                      "hage"

これは出来ない。

なぜなのか考えた結果得た結論。

    let str: String = "hoge";  // <- セミコロンある
                      "hage"

と区別が付かないから。

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1