Strings in Kotlin (1. raw string 2. escaped string)
Strings in Kotlin (1. raw string 2. escaped string) :
- Strings are like character arrays like c# and Java.
- we have two types of strings in Kotlin 1. raw string 2. escaped string
- escaped String allows to provide extra line space after the first print statement
Example Program:
fun main(args : Array<String>)
{
var rawString :String = "I am Raw String!"
val escapedString : String = "I am escaped String!\n"
println("Hello!"+escapedString)
println("Hey!!"+rawString)
}
Result:
Hello!I am escaped String!
Hey!!I am Raw String!
No comments