Hi everyone, quick question, can we use `when` wit...
# getting-started
j
Hi everyone, quick question, can we use
when
with strings? Whenever i try using when with a string i get an error:
Copy code
>>> val test = "Hello"
>>> val test2 = test.replace("lo", "1")
>>> println(test2)
Hel1
>>> when(test2) { 'Hel1' -> println("Hello world") }
error: incompatible types: Char and String
when(test2) { 'Hel1' -> println("Hello world") }
              ^