JavaScript Remove Certain Characters from String

Remove character from String in JavaScript

  1. substr() — It helps to removes a character from a particular index in the String.
  2. replace() — The replaces a specific character/string with another character/string.
  3. slice() — This method help tp extracts parts of a string between the given parameters.
  4. replace() method with a regular expression.

JavaScript String replace()

replace() method with a regular expression

Removing character from string using slice()

Removing a specific character using substr()

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store