Created
November 3, 2025 14:58
-
-
Save bishabosha/d837c48ff51d9488b277748b21fbce4e to your computer and use it in GitHub Desktop.
Useful Scala string interpolators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension (ctx: StringContext) | |
| /** Regex pattern */ | |
| transparent inline def rg(s: Any*): scala.util.matching.Regex = | |
| ctx.raw(s*).r | |
| /** Whitespace-Separated list*/ | |
| transparent inline def ws(s: Any*): IndexedSeq[String] = | |
| ctx.s(s*).split(raw"\s+").filter(_.nonEmpty).toIndexedSeq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment