compareto kotlin code example
Example: kotlin compare string
val first = "code"
val second = "code"
val firstCapitalized = "Code"
assertTrue { first == second }
assertFalse { first == firstCapitalized }
assertTrue { first.equals(second) }
assertFalse { first.equals(firstCapitalized) }
assertTrue { first.equals(firstCapitalized, true) }
assertTrue { first.compareTo(second) == 0 }
assertTrue { first.compareTo(firstCapitalized) == 32 }
assertTrue { firstCapitalized.compareTo(first) == -32 }
assertTrue { first.compareTo(firstCapitalized, true) == 0 }