- 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.
推薦閱讀
- SPSS數(shù)據(jù)挖掘與案例分析應(yīng)用實(shí)踐
- Oracle從入門到精通(第3版)
- Learn Blockchain Programming with JavaScript
- Building a RESTful Web Service with Spring
- Java Web開發(fā)之道
- Learn Programming in Python with Cody Jackson
- 碼上行動(dòng):用ChatGPT學(xué)會(huì)Python編程
- C語(yǔ)言程序設(shè)計(jì)教程
- SQL Server從入門到精通(第3版)
- PHP從入門到精通(第4版)(軟件開發(fā)視頻大講堂)
- JavaScript+jQuery網(wǎng)頁(yè)特效設(shè)計(jì)任務(wù)驅(qū)動(dòng)教程
- Exploring SE for Android
- 超簡(jiǎn)單:Photoshop+JavaScript+Python智能修圖與圖像自動(dòng)化處理
- Tableau Dashboard Cookbook
- Python機(jī)器學(xué)習(xí)開發(fā)實(shí)戰(zhàn)