15 1 0 4000 1 https://codeblock.co.za 300 true 0
theme-sticky-logo-alt

str.trim()

0 Comments

Programming Language

JavaScript [Version: ECMAScript (ECMA-262)]

Examples of str.trim()

let myName = " Brinley Pavitt       ";
console.log(myName.trim());

The above will log “Brinley Pavitt” to the console, deleting all whitespace from the beginning and the end of the string. The whitespace between characters remains intact.

Was This Helpful?

Previous Post
array.length
Next Post
str.split()

0 Comments

Leave a Reply