- Learn Kotlin Programming(Second Edition)
- Stephen Samuel Stefan Bocutiu
- 107字
- 2021-06-24 14:13:26
Strings
Just as in Java, strings are immutable. String literals can be created using double quotes or triple quotes. Double quotes create an escaped string. In an escaped string, special characters, such as new line, must be escaped:
val string = "string with \n new line"
Triple quotes create a raw string. In a raw string, no escaping is necessary, and all characters can be included:
val rawString = """ raw string is super useful for strings that span many lines """
Strings also provide an iterator function that can be used in a for loop. This will be described later in the Loops section.
推薦閱讀
- Java應用與實戰
- 信息可視化的藝術:信息可視化在英國
- Architecting the Industrial Internet
- Visual Basic程序設計習題解答與上機指導
- 概率成形編碼調制技術理論及應用
- 利用Python進行數據分析(原書第3版)
- Apache Mahout Clustering Designs
- Serverless computing in Azure with .NET
- C#實踐教程(第2版)
- Kotlin開發教程(全2冊)
- Python項目實戰從入門到精通
- C語言程序設計習題與實驗指導
- FPGA嵌入式項目開發實戰
- 30天學通C#項目案例開發
- Learning Image Processing with OpenCV