开发者

Remove a word from a string

开发者_StackOverflow

i want to remove a particular #keyword from a string. i dont know its position or anything. can i use javascript to do it?


var str = "particular #keyword";
str.replace("keyword", "new");
alert(str); //-> "particular #new"


yes, you can, using .replace() method

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜