Skip to content

Instantly share code, notes, and snippets.

@kalaiselvan369
Last active June 8, 2023 11:43
Show Gist options
  • Save kalaiselvan369/464ce8ca09c3f3279ee081327a91b5b1 to your computer and use it in GitHub Desktop.
Save kalaiselvan369/464ce8ca09c3f3279ee081327a91b5b1 to your computer and use it in GitHub Desktop.
usage of 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