Skip to content

About

Simple Scala 3 library for replacing placeholders in strings

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

27 Commits

Folders and files

Repository files navigation

Replacements

Scala Native Scala.js Latest version Build Status codecov

Simple Scala 3 library for replacing placeholders in strings.

Usage

import io.github.matejcerny.replacements.*

case class MyValues(name: String, age: Int) derives ReplacementValues
val myValues = MyValues("John", 42)

val toBeReplaced = "Hello, {{name}}! You are {{age}} years old."

toBeReplaced.substitute(myValues) // Hello, John! You are 42 years old.
myValues.substitute(toBeReplaced) // Hello, John! You are 42 years old.

Installation

Add the library as a dependency:

libraryDependencies += "io.github.matejcerny" %% "replacements" % "0.3.2"

About

Simple Scala 3 library for replacing placeholders in strings

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages