- Kotlin Programming By Example
- Iyanu Adelekan
- 109字
- 2021-08-27 20:00:08
Char
This type is used to represent characters. A character is a unit of information that roughly corresponds to a grapheme, or a grapheme-like unit or symbol. In Kotlin, characters are of the Char type. Characters in single quotes in Kotlin, such as a, $, %, and &, are all examples of characters:
val c: Char = 'i' // I am a character
Recall we mentioned earlier that a string is a sequence of characters:
var c: Char
val sentence: String = "I am made up of characters."
for (character in sentence) {
c = character // Value of character assigned to c without error
println(c)
}
推薦閱讀
- Learning Selenium Testing Tools with Python
- 編寫整潔的Python代碼(第2版)
- 精通搜索分析
- 精通軟件性能測試與LoadRunner實戰(zhàn)(第2版)
- Python Geospatial Development(Second Edition)
- Java EE 7 Development with NetBeans 8
- Learning OpenStack Networking(Neutron)(Second Edition)
- UNIX Linux程序設(shè)計教程
- Building Wireless Sensor Networks Using Arduino
- Cocos2d-x by Example:Beginner's Guide(Second Edition)
- C指針原理揭秘:基于底層實現(xiàn)機(jī)制
- Android 游戲開發(fā)大全(第二版)
- Selenium WebDriver Practical Guide
- 實戰(zhàn)Python網(wǎng)絡(luò)爬蟲
- PHP+MySQL Web應(yīng)用開發(fā)教程