Write a node.js program to replace two or more a's with the letter b on the given string using Regular Expression
belongs to collection: Node.js programming Exercises
All Answers
total answers (1)
belongs to collection: Node.js programming Exercises
total answers (1)
Solution
JavaScript has powerful regular expression support.
A certain number of string functions can take arguments that are regular expressions to perform their work. These regular expressions can either be entered in literal format or as a call to the constructor of a RegExp object. The RegExp object is used for matching text with a pattern.
Output of the above code:
need an explanation for this answer? contact us directly to get an explanation for this answer