Last active
June 8, 2023 11:43
-
-
Save kalaiselvan369/464ce8ca09c3f3279ee081327a91b5b1 to your computer and use it in GitHub Desktop.
usage of characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
val escapeQuotes = "\"a\"" | |
println("\thello") | |
println('\n') | |
println(escapeQuotes) | |
println("\\h") | |
println('5'.code) // prints the ASCII code | |
println(56.toChar()) // prints 8 the value for ASCII code 56 | |
val five = '5' | |
println(five.digitToInt()) | |
val result = 'x' + 1 | |
println(result) // prints y | |
// In ASCII table x has a value of 120. 120 + 1 = 121 | |
// In ASCII table 121 refers to y | |
val bingo = 'z' + 1 | |
println(bingo) // prints { | |
// Characters as identified based on the ASCII code. | |
// LOOK at the ASCII Table for reference. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment