1 Answers
Here is the code to compare two strings.
fun main(args:Array <String>){
var string1 : String = “Chetan”
var string2 : String = “Chetan”
if(string1.equals(string2))
println(“Same”)
else
println(“Not same”)
}
Output:
Same
fun main(args:Array <String>){
var string1 : String = “chetan”
var string2 : String = “Chetan”
if(string1.equals(string2))
println(“Same”)
else
println(“Not same”)
}
Output:
Not same