0
How to remove a part of a string in js?
For example: let text = "Hello World!;" console.log("Before: " + text); text.remove( 5, 7); console.log("After: " + text); Expected output: Before: Hello World! After: Hello
1 Réponse
+ 3
Use substr function
console.log(text.substr(0, 5)); // Hello