Useful JavaScript STRING METHODS 🧵
Вставка
- Опубліковано 20 лип 2024
- 00:00:00 intro
00:00:28 .charAt()
00:01:34 .indexOf()
00:02:03 .lastIndexOf()
00:02:15 .length
00:02:40 .trim()
00:03:13 .toUpperCase()
00:03:22 .toLowerCase()
00:03:28 .repeat()
00:03:42 .startWith()
00:05:00 .endsWith()
00:05:18 .includes()
00:05:43 .replaceAll()
00:06:53 .padStart()
00:07:35 .padEnd()
00:07:45 conclusion
// string methods = allow you to manipulate and work with text (strings)
let userName = "Bro Code";
let phoneNumber = "123-456-7890";
//console.log(userName.length);
//console.log(userName.charAt(0));
//console.log(userName.indexOf("o"));
//console.log(userName.lastIndexOf("o"));
//userName = userName.trim();
//userName = userName.toUpperCase();
//userName = userName.toLowerCase();
//userName = userName.repeat(3);
//let result = userName.startsWith(" ");
//let result = userName.endsWith(" ");
//let result = userName.includes(" ");
//phoneNumber = phoneNumber.replaceAll("-", "");
//phoneNumber = phoneNumber.padStart(15, "0");
//phoneNumber = phoneNumber.padEnd(15, "0");
console.log(phoneNumber);
// string methods = allow you to manipulate and work with text (strings)
let userName = "Bro Code";
let phoneNumber = "123-456-7890";
//console.log(userName.length);
//console.log(userName.charAt(0));
//console.log(userName.indexOf("o"));
//console.log(userName.lastIndexOf("o"));
//userName = userName.trim();
//userName = userName.toUpperCase();
//userName = userName.toLowerCase();
//userName = userName.repeat(3);
//let result = userName.startsWith(" ");
//let result = userName.endsWith(" ");
//let result = userName.includes(" ");
//phoneNumber = phoneNumber.replaceAll("-", "");
//phoneNumber = phoneNumber.padStart(15, "0");
//phoneNumber = phoneNumber.padEnd(15, "0");
console.log(phoneNumber);
The video was postet 33 minutes ago but the comment is 1 month old 🤨
dude I'm finally understanding java script!
superb video
Daddy Brocode teaches me lots
Why you always write that same comment 😭
Thanks
Wow, Javascript has string methods!
Great video and It is so funny how to teach beginners the trim method and you say “hey white spaces removed from console “ where its not showing with or without trim 😂
Can you make a tutorial on ruby aswell please
Key Insights
🎯 The CharAt method is useful for retrieving individual characters from a string, using their corresponding index.
🎯 The IndexOf method helps in finding the index of the first occurrence of a character in a string, which can be useful for further manipulations.
🎯 The Length property provides a simple way to determine the length of a string, which is often needed for various operations.
🎯 The Trim method is handy for removing leading and trailing whitespace from a string, ensuring clean input.
🎯 The ToUpperCase and ToLowerCase methods enable easy conversion of a string to uppercase and lowercase, respectively.
🎯 The Includes method helps in checking whether a string contains a specific substring, which is useful for conditional checks.
🎯 String methods provide powerful tools for manipulating and working with text, enhancing the functionality of JavaScript applications.
node js and express js tutorils bro