By Alvin Alexander. Last updated: March 1, 2017
If you ever need to print 25 blank spaces in Scala, this works:
println(" " * 25)
That’s pretty cool (and convenient) that you can repeat X number of characters with such a concise syntax like that. Of course you don’t have to just print the characters out, you can also assign them to a value and then use them however you want to:
val x = "a" * 10