I went through the answer on Purpose of Scala's Symbol?
I want to create a Symbol but it has space in it.
Ex:
val s = "Hello World"
val syb = 'Hello World
syb
gives compile time error. Is it possible to create a Symbol with spaces?
I went through the answer on Purpose of Scala's Symbol?
I want to create a Symbol but it has space in it.
Ex:
val s = "Hello World"
val syb = 'Hello World
syb
gives compile time error. Is it possible to create a Symbol with spaces?
It is possible to create a Symbol
with spaces with the Symbol.apply
method:
scala> val syb = Symbol("Hello World")
syb: Symbol = 'Hello World