0

i have a value like the following : ...India in this i want to remove ... if it is exist in the value.

How to do this using underscore.js or jquery or javascript ??

Thanks

2
  • 1
    var myString = myString.replace('...,''); Commented Jul 10, 2013 at 10:52
  • +1 for all the answers, Thanks a lot Commented Jul 10, 2013 at 11:20

3 Answers 3

2

You can do this with the basic JavaScript replace method

var myString = myString.replace('...','');

If you need more complex replacing then you will probably want to look into using a RegEx pattern.

Sign up to request clarification or add additional context in comments.

Comments

1

Try regexp as:

"...India".replace(/\./g, '');

Comments

1

use replace()

var data="...India";
alert(data.replace('...',''));

however this replace all the occurence of the searched string... this won't work if you have just ..India .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.