Using String.replace with Regular Expressions in Javascript


Replace parts of a string using regular expressions.

Source Code

let text = 'Hello, world!';
console.log(text.replace(/world/, 'JavaScript'));
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments