Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to Use the trim() String Method in javascript

const string = "  H ell  o world  "

const modified = string.trim()

console.log(string)
//   H ell  o world 

console.log(modified)
// H ell  o world
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #How #Use #String #Method #javascript
ADD COMMENT
Topic
Name
8+2 =