I have a list of shortcuts:
var shortcuts = ["efa","ame","ict","del","aps","lfb","bis","bbc"...
and the text of the text of various capitalization:
var myText = "Lorem ipsum... Efa, efa, EFA ...";
Is it possible to replace all words in the text corresponding to the list of labels with the title version of the label using a regular expression? Is it possible to do this without a loop with just String.prototype.replace () ?
The desired result in my example:
myText = "Lorem ipsum... EFA, EFA, EFA ...";
source share