How to use 'remove n from string javascript' in JavaScript

Every line of 'remove n from string javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
67function removeRN(str) {
68 if (typeof str !== 'string') {
69 throw new Error(`'str' must be of type "String", actually is ${typeof str}`);
70 }
71 return str.replace(/[\r\n]/g, '');

Related snippets