Answers for "how to remove trailing space in string js"

1

how to remove trailing space in string js

let string = "        Your Text           ";
string = string.trim(); // "Your Text"
// This gets rid of both starting and trailing whitespace
Posted by: Guest on June-02-2021

Code answers related to "how to remove trailing space in string js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language