January 2018
Intermediate to advanced
434 pages
14h 1m
English
String templates also come in handy with String properties and functions. Here's an example:
fun main(args: Array<String>) { val str1="abcdefghijklmnopqrs" val str2="tuvwxyz" println("str1 equals str2 ? = ${str1.equals(str2)}") println("subsequence is ${str1.subSequence(1,4)}") println("2nd character is ${str1.get(1)}") }
Here's the output:
str1 equals str2 ? = falsesubsequence is bcd2nd character is b
Read now
Unlock full access