Answers for "replace string in dart,replace string in dart using regex"

2

replace string in dart,replace string in dart using regex

var greetingTemplate = 'Hello, NAME!';
var greeting =
    greetingTemplate.replaceAll(RegExp('NAME'), 'Bob');

// greetingTemplate didn't change.
assert(greeting != greetingTemplate);
Posted by: Guest on April-24-2021

Browse Popular Code Answers by Language