Answers for "js remove whitespace from start and end of string"

22

remove spaces in a string js

str.replace(/\s+/g, '')
Posted by: Guest on April-29-2020
0

remove whitespace with regex javascript

return str.replace(/\s/g, '');
Posted by: Guest on November-29-2020
10

js remove space before string

var str = "  Some text ";
str.trim();
// str = "Some text"
Posted by: Guest on May-27-2020
9

remove whitespace javascript

var str = "  Some text ";
str.trim();
Posted by: Guest on July-14-2020
0

suppress spaces in front and in the end of a string javascript

var hello = '     Hello there!    ';

// returns "Hello there!"
hello.trim();
Posted by: Guest on October-15-2020

Code answers related to "js remove whitespace from start and end of string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language