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

pl.morgaroth.utils.strings.replaceAllAll.scala Maven / Gradle / Ivy

package pl.morgaroth.utils.strings

object replaceAllAll {

  class RichString(str: String) {

    def replaceAllAll(pairRegexReplacement: Seq[(String, String)]): String =
      pairRegexReplacement match {
        case Nil => str
        case head :: tail => wrapToReplacingAllAllString(str.replaceAll(head._1, head._2)).replaceAllAll(tail)
      }

    def replaceAllAll(pairRegexReplacement: (String, String)*)(implicit s: DummyImplicit): String = replaceAllAll(pairRegexReplacement)
  }

  import scala.language.implicitConversions

  implicit def wrapToReplacingAllAllString(str: String) = new RichString(str)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy