Swift字元unicode編碼

來源:互聯網
上載者:User

標籤:swift字元unicode編碼

1、字元

    在C# Object語言中,字元放在單引號(‘)之間,但是在swift語言中,必須把字元放在雙引號之間;


    (1)unicode編碼

            unicode編碼可以有單位元組編碼,雙位元組編碼和四位元組編碼,它們的表現形式是"\u{n}",其中n為1到8個十六進位字元


        let andSign1:Character="&"

        let andSign2="\u{26}"


        

        let  lamda1:Character=""

        let lamda2="\u{03bb}"


    (2)轉義符


        \t 定位字元


        \n換行

        \r斷行符號

        \""雙引號

        \‘‘單引號

        \\反斜線


本文出自 “平凡之路” 部落格,請務必保留此出處http://linjohn.blog.51cto.com/1026193/1619398

Swift字元unicode編碼

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.