All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala-cask.appPackage.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
{{>licenseInfo}}
package {{packageName}}

def box(str: String): String = {
  val lines = str.linesIterator.toList
  val maxLen = (0 +: lines.map(_.length)).max
  val boxed = lines.map { line =>
    s" | ${line.padTo(maxLen, ' ')} |"
  }
  val bar = " +-" + ("-" * maxLen) + "-+"
  (bar +: boxed :+ bar).mkString("\n")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy