trim, trimStart and trimEnd methods | String Object In JavaScript

Veröffentlicht am: 06 August 2022
auf dem Kanal: Code Explained
5,615
90

🎁 Join my channel to get access to perks:
   / @codeexplained  

🧡 Hello All JavaScript Lovers Outhere!

Today you're going to learn about the String Object In JavaScript.

This tutorial is a series of videos, in each video we will discuss a method (or more) of the String Object in JavaScript.

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 :
trip()
trimStart()
trimEnd()

🔷 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 :   / code.explained.official  
◾ Twitter :   / code_explained  
◾ Instagram :   / code.explained.official  
◾ GitHub : https://github.com/CodeExplainedRepo

💲 Suppport the Channel
Paypal : https://paypal.me/CodeExplained
Buy Me a Coffee: https://www.buymeacoffee.com/CodeExpl...


Auf dieser Seite können Sie das Online-Video trim, trimStart and trimEnd methods | String Object In JavaScript mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Code Explained 06 August 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 5,615 Mal angesehen und es wurde von 90 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!