开发者

Change string using JavaScript

var a = "Text(money ='3/3/dollor',unit=42)";

I want to get rid of money ='3/3/dollor',

Using javascript, how to do this?

Sorry I did not make this very clear, the string after money = can be anything but they are string for sure, and always ends up with an comma.

More samples

var a = "Text(money ='v23f3/.3/do开发者_C百科llor',unit=42)";
var a = "Text(money ='3/3fds/d.ollor',unit=42)";
var a = "Text(money ='3.3.3.3/3/d.o/l.lor',unit=42)";
var a = "Text(money ='3/3/dollor',unit=42)";

The output I need is a = "Text(unit=42)"


a = a.replace(/money ='.*',/, "");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜