a73856be66
Relates to ^KT-40016
19 lines
542 B
HTML
19 lines
542 B
HTML
<html>
|
|
<body>
|
|
This inspection reports case insensitive comparison that can be replaced with <b>equals(..., ignoreCase = true)</b>.
|
|
By using <b>equals()</b> you won't have to allocate any extra strings with <b>toLowerCase()/toUpperCase()</b> to do the comparison.
|
|
<br><br>
|
|
For example:
|
|
<br>
|
|
<pre>
|
|
fun main() {
|
|
val a = "KoTliN"
|
|
val b = "KOTLIN"
|
|
println(a.toLowerCase() == b.toLowerCase()) // can be replaced with "a.equals(b, ignoreCase = true)"
|
|
}
|
|
</pre>
|
|
<br><br>
|
|
<b>Note:</b> May change semantics for some locales.
|
|
</body>
|
|
</html>
|