trim, trimStart and trimEnd methods | String Object In JavaScript

Pubblicato il: 06 agosto 2022
sul canale di: 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...


In questa pagina del sito puoi guardare il video online trim, trimStart and trimEnd methods | String Object In JavaScript della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Code Explained 06 agosto 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 5,615 volte e gli è piaciuto 90 spettatori. Buona visione!