filmov
tv
How Slice is different from Substring | JavaScript Tamil Tutorial - Part 18

Показать описание
In practical terms, slice and substring are often used interchangeably for similar purposes. The key difference between them is how they handle negative indices:
slice allows you to use negative indices to count from the end of the string. For example, slice(-5) would extract the last 5 characters of a string.
substring treats negative indices as if they were 0. For example, substring(-5) is equivalent to substring(0) and would extract characters from the beginning of the string.
Both methods are useful for extracting substrings from strings, and your choice between them may depend on your specific use case and whether you need to support negative indices.
Source code:
Presentation link:
Chapters:
0:00 String concepts part 5
1:09 Quokka plugin installation
2:42 Slice and Substring demo
9:03 Example of automation
10:33 CharAt demo
11:29 Example program
------------------------------- Membership --------------------------------
Join membership to help me bring more awesome content like this
------------------------------- SOCIAL --------------------------------
---------------------------------------------------------------------
🎁Support Koushik.
-------------------------- Thank you ---------------------------
Thanks for watching, If you like the video, give it a thumbs up 👆.
Sharing is caring, kindly share the video with your friends and colleagues.
Don't forget to subscribe and hit the bell 🔔 notification.
#kurimurai
slice allows you to use negative indices to count from the end of the string. For example, slice(-5) would extract the last 5 characters of a string.
substring treats negative indices as if they were 0. For example, substring(-5) is equivalent to substring(0) and would extract characters from the beginning of the string.
Both methods are useful for extracting substrings from strings, and your choice between them may depend on your specific use case and whether you need to support negative indices.
Source code:
Presentation link:
Chapters:
0:00 String concepts part 5
1:09 Quokka plugin installation
2:42 Slice and Substring demo
9:03 Example of automation
10:33 CharAt demo
11:29 Example program
------------------------------- Membership --------------------------------
Join membership to help me bring more awesome content like this
------------------------------- SOCIAL --------------------------------
---------------------------------------------------------------------
🎁Support Koushik.
-------------------------- Thank you ---------------------------
Thanks for watching, If you like the video, give it a thumbs up 👆.
Sharing is caring, kindly share the video with your friends and colleagues.
Don't forget to subscribe and hit the bell 🔔 notification.
#kurimurai
Комментарии