You can start with an Array
and build its elements.
Array.tabulate(26)(x => (x+'a').toChar.toString * k)
Or you can start with the elements and then transition to an Array
.
('a' to 'z').map(_.toString * k).toArray
More Related Contents:
- Combining two lists into one in Scala
- Spark Scala: How to convert Dataframe[vector] to DataFrame[f1:Double, …, fn: Double)]
- How to override apply in a case class companion
- Getting the desugared part of a Scala for/comprehension expression?
- Scala: How to define “generic” function parameters?
- Spark losing println() on stdout
- Spark DataFrame: does groupBy after orderBy maintain that order?
- Cartesian product of two lists
- Spark UDAF with ArrayType as bufferSchema performance issues
- I want to get the type of a variable at runtime
- Two ways of currying in Scala; what’s the use-case for each?
- When to use the equals sign in a Scala method declaration?
- How to get ID of a map task in Spark?
- “new” keyword in Scala
- Spark: produce RDD[(X, X)] of all possible combinations from RDD[X]
- Scala underscore minimal function
- Debugging Scala code with simple-build-tool (sbt) and IntelliJ
- Scala case class inheritance
- Use functional combinators on Scala Tuples?
- scala tuple unpacking
- Using varargs from Scala
- Can’t prove that singleton types are singleton types while generating type class instance
- Clarification needed about futures and promises in Scala
- Difference between MutableList and ListBuffer
- Creating a method definition tree from a method symbol and a body
- forall in Scala
- Treating an SQL ResultSet like a Scala Stream
- Scala asInstanceOf with parameterized types
- How do I run an sbt main class from the shell as normal command-line program?
- Akka-Stream implementation slower than single threaded implementation