how to remove trailing space in string js

Solutions on MaxInterview for how to remove trailing space in string js by the best coders in the world

showing results for - "how to remove trailing space in string js"
Francesca
31 Jul 2017
1let string = "        Your Text           ";
2string = string.trim(); // "Your Text"
3// This gets rid of both starting and trailing whitespace