scala - Alphabetical range not displaying in IntelliJ IDEA console as expected -
i'm following tutorial on range
here. sample code is
val alphabetrangefromatoz = 'a' 'z' println(s"range of alphabets z = $alphabetrangefromatoz")
the expected output according tutorial is:
range of alphabets z = numericrange(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)
what in intellij idea console output is:
range of alphabets z = numericrange z
is expected behavior idea? can configure idea in manner display output in way tutorial shows range?
this due using newer scala version tutorial author. behavior changed in scala 2.12. output in tutorial how used work , output seeing new behavior.
if want string showing of included elements can use th mkstring
method on range
val range = 'a' 'z' println(range.mkstring(", "))
prints
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
Comments
Post a Comment