Suppose you're building a system in Kotlin that needs to compare Unicode characters. You need to find out if a particular character is the same as its Unicode representation. Fill the blanks in the code snippet to compare a hardcoded character with its Unicode equivalent and print the result.
Characters. Char type
Comparing a character with its Unicode representation
Report a typo
Fill in the gaps with the relevant elements
fun main() {
char1 = ''
val char2 = '\u004B'
if (char1 == char2) {
println("Both are same")
} else {
println("Both are different")
}
} ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.