views:

50

answers:

2

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

+1  A: 

yes, you can, using .replace() method

pawel
To clarify that is not a JavaScript function, not jQuery dependent.
Dustin Laine
@durilai, you mean that **is a** JavaScript function? :P
Anurag
@Anurag, thanks yes it was a typo.
Dustin Laine
+1  A: 
var str = "particular #keyword";
str.replace("keyword", "new");
alert(str); //-> "particular #new"
jitter