🎁 Join my channel to get access to perks:
In today’s video, you’re going to learn about the trim, trimStart, and trimEnd methods.
The trim() method removes whitespace from both ends of a string and returns a new string, without modifying the original string.
The trimStart() method removes whitespace from the beginning of a string. trimLeft() is an alias of this method.
The trimEnd() method removes whitespace from the end of a string. trimRight() is an alias of this method.
🟢🟠 The string.trim() string.trimStart() and string.trimEnd().
🔷 Syntax :
🔷 Example :
const greeting = ‘ Hello World! ‘;
console.log( greeting.trim() ); // ‘Hello World!’
console.log( greeting.trimStart() ); // ‘ Hello World! ‘
console.log( greeting.trimEnd() ); // ‘ Hello World!’
🌍 Social Media Links.
◾ Facebook : https://www.facebook.com/Code.Explained.Official
◾ Twitter : https://twitter.com/code_explained
◾ Instagram : https://www.instagram.com/Code.Explained.Official/
◾ GitHub : https://github.com/CodeExplainedRepo
💲 Suppport the Channel
Paypal : https://paypal.me/CodeExplained
Buy Me a Coffee: https://www.buymeacoffee.com/CodeExplained