25 Tweets 9 reads Oct 12, 2022
25 JavaScript Strings Properties & Methods๐Ÿ”ฅ
In JavaScript, Strings are used to represent and work with a sequence of characters.๐ŸŽฏ
Thread๐Ÿงต
1. length๐Ÿ“Œ
Returns the number of characters in a string
2. replace()๐Ÿ“Œ
replace a substring/pattern in the string.
3. indexOf()๐Ÿ“Œ
Returns the first index of occurrence of a value.
4. lastIndexOf()๐Ÿ“Œ
Returns the last index of occurrence of a value.
5. startsWith()๐Ÿ“Œ
Checks if a string begins with a specified string.
6. endsWith()๐Ÿ“Œ
Checks if a string ends with a specified string.
7. toUpperCase()๐Ÿ“Œ
Returns uppercase of a string.
8. toLowerCase()๐Ÿ“Œ
Returns lowercase representation of a string.
9. includes()๐Ÿ“Œ
Checks if given string is found inside a string.
10. repeat()๐Ÿ“Œ
Returns a string by repeating it given times.
11. charAt()๐Ÿ“Œ
Returns character at a specified index in string.
12. charCodeAt()๐Ÿ“Œ
Returns Unicode of the character at given index.
13. fromCharCode()๐Ÿ“Œ
Returns a string from the given UTF-16 code units.
14. substring()๐Ÿ“Œ
Returns a specified part of the string.
15. padStart()๐Ÿ“Œ
Pads a string at the start to a given length.
16. padEnd()๐Ÿ“Œ
Pads a string at the end to a given length.
17. codePointAt()๐Ÿ“Œ
Returns the Unicode point value at given index.
18. fromCodePoint()๐Ÿ“Œ
Returns a string using the given code points.
19. match()๐Ÿ“Œ
Returns result of matching string with a regex.
20. localeCompare()๐Ÿ“Œ
Compares two strings in the current locale.
21. search()๐Ÿ“Œ
Searches for specified value in the string.
22. concat()๐Ÿ“Œ
Concatenates the arguments to the calling string.-
23. split()๐Ÿ“Œ
Returns the string divided into list of substring.
24. trim()๐Ÿ“Œ
Removes whitespace from both ends of a string.
25. slice()๐Ÿ“Œ
Extracts and returns a section of the string.
If you enjoyed reading this thread, please do the following:
1. Like the threadโค๏ธ
2. Retweet the first tweet.๐Ÿ”ƒ
3. Follow me and enable notifications: โœ…
@ajaysharma_dev
Thank you for reading all the way through.

Loading suggestions...