Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
 
PREVIOUS NEXT
Tagged: #remove #trailing #space #string #js
ADD COMMENT
Topic
Name
7+5 =