Files
kotlin-fork/idea/resources-en/inspectionDescriptions/ReplaceWithIgnoreCaseEquals.html
T
Vladimir Dolzhenko a73856be66 Add warn message to ReplaceWithIgnoreCaseEquals inspection.
Relates to ^KT-40016
2020-09-10 08:20:54 +00:00

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>