replace method

String replace(
  1. String target,
  2. String newValue
)

Replaces the content of the target template with a new value for this entry. This knows it's place within the target and will replace the value in the target with the newValue that was passed in.

Implementation

String replace(String target, String newValue) {
  final prefix = target.substring(0, startPosition);
  final suffix = target.substring(
    startPosition + _value.length,
    target.length,
  );

  return '$prefix$newValue$suffix';
}