#4 JavaScript String Methods
00:00 Introduction 03:17 Regex 06:08 length 07:37 charAt() 10:06 indexOf() 12:58 slice() 15:33 substring() 16:39 concat() 18:22 includes() 20:49 match() 24:00 search() 25:26 split() 27:42 toUpperCase() 28:45 toLowerCase() 29:19 trim() 30:44 trimStart() 33:18 trimEnd() 34:45 padStart 38:05 padEnd 39:05 startsWith 43:14 endsWith 44:10 replace 1. length: Returns the number of characters in a string. 2. charAt(index): Returns the character at the specified index in a string. 3. indexOf(substring): Returns the index of the first occurrence of a substring in a string. Returns -1 if the substring is not found. 4. slice(startIndex, endIndex): Returns a portion of a string between the specified startIndex and endIndex. 5. substring(startIndex, endIndex): Returns a substring between the specified startIndex and endIndex in a string. 6. concat(str1, str2, ...): Concatenates two or more strings and returns a new string. 7. includes(searchString): Checks if a string contains the specified searchString and returns a boolean. 8. match(regexp): Searches a string for a match against a regular expression and returns an array of matches. 9. search(regexp): Searches a string for a match against a regular expression and returns the index of the first match. 10. split(separator): Splits a string into an array of substrings based on the specified separator. 11. toUpperCase(): Converts all characters in a string to uppercase. 12. toLowerCase(): Converts all characters in a string to lowercase. 13. trim(): Removes whitespaces from both ends of a string. 14. trimStart(): Removes whitespaces from the beginning of a string. 15. trimEnd(): Removes whitespaces from the end of a string. 16. padStart(targetLength, padString): Pads the start of a string with a specified padString until the resulting string reaches the targetLength. 17. padEnd(targetLength, padString): Pads the end of a string with a specified padString until the resulting string reaches the targetLength. 18. startsWith(prefix): Checks if a string starts with a specified prefix and returns a boolean. 19. endsWith(suffix): Checks if a string ends with a specified suffix and returns a boolean. 20. replace(search, replacement): Replaces the first occurrence of a specified value (search) with another value (replacement) in a string.
Download
0 formatsNo download links available.