toReplace method

String toReplace(
  1. RegExp pattern,
  2. String replacement
)

Replaces matches for pattern in string with replacement. Example: "hello" -> "hello" -> "hello"

Implementation

String toReplace(RegExp pattern, String replacement) =>
    replace(this, pattern, replacement);