Javascript for replacing an abreviation by his equivalent

前端 未结 5 781
情话喂你
情话喂你 2021-01-26 05:00

I met some trouble with a javascript.

In fact I have in my database many records that are abreviations and ther equivalent,

for example, replace tel => telephon

5条回答
  •  无人及你
    2021-01-26 05:46

    Use replace method for replacing a word in string.

    eg:

    var str = "This is AIR";
    var newstr = str.replace("AIR", "All India Radio");
    console.log(newstr);
    

提交回复
热议问题