compare 2 strings kotlin

Solutions on MaxInterview for compare 2 strings kotlin by the best coders in the world

showing results for - "compare 2 strings kotlin"
Jody
20 Jan 2019
1string1 == string2 //returns true if they are equal and false if they are not
Betty
02 Jul 2020
1val hello = "Hello"
2    val world = "World"
3
4    // equals() returns true or false
5    val equals = hello.equals(world)
6
7    // compareTo() will return 0 if true
8    // Any non zero value is false
9    val compare = hello.compareTo(world)