https://kotlinlang.org logo
Title
t

tjohnn

08/15/2019, 10:06 AM
Hi, anyone know why I am getting this as an error in kotlin but not in java? It is not allowing project to build either
n

nfrankel

08/15/2019, 10:07 AM
kotlin offers string interpolation with the
$
sign hence, if you use
$
in a string kotlin will expect the next characters to be a variable name
d

diesieben07

08/15/2019, 10:07 AM
t

tjohnn

08/15/2019, 10:08 AM
Ha I see, is there a way I can achieve the same thing?
d

diesieben07

08/15/2019, 10:08 AM
You need to escape the `$`:
\$
t

tjohnn

08/15/2019, 10:09 AM
Thanks
Lol.. I have used the string interpolation a million times but it did not come to my mind in this use case