![JAR search and dependency download from the Maven repository](/logo.png)
org.scalameta.show.Escape.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalameta-foundation_2.11 Show documentation
Show all versions of scalameta-foundation_2.11 Show documentation
Metaprogramming and hosting APIs of scala.meta
The newest version!
package org.scalameta.show
object escape {
def apply(s: String): String = {
// TODO: comprehensive handling
val codepage = Map(
"\t" -> "\\t",
"\b" -> "\\b",
"\n" -> "\\n",
"\r" -> "\\r",
"\f" -> "\\f",
"\\" -> "\\\\"
)
s.flatMap(c => codepage.getOrElse(c.toString, c.toString))
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy