- 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.
推薦閱讀
- 一步一步學(xué)Spring Boot 2:微服務(wù)項(xiàng)目實(shí)戰(zhàn)
- Mastering Ember.js
- Ext JS Data-driven Application Design
- HTML5 and CSS3 Transition,Transformation,and Animation
- SharePoint Development with the SharePoint Framework
- Building Microservices with .NET Core
- 零基礎(chǔ)學(xué)Kotlin之Android項(xiàng)目開發(fā)實(shí)戰(zhàn)
- 用案例學(xué)Java Web整合開發(fā)
- 時(shí)空數(shù)據(jù)建模及其應(yīng)用
- Practical Predictive Analytics
- Learning D
- SAP Web Dynpro for ABAP開發(fā)技術(shù)詳解:基礎(chǔ)應(yīng)用
- 從零開始學(xué)算法:基于Python
- 你好!Java
- SQL Server 2008實(shí)用教程(第3版)