Let's pick up, where we left off and cover more string methods.
indexOf() and lastIndexOf() The indexOf() method helps you find the first occurrence of a specified substring within a string. while lastIndexOf() does the same but starts searching from the end of the string:
The includes() method checks whether a substring is present within a string, returning a Boolean value:
startsWith() and endsWith()
To check if a string starts or ends with a specific substring, use the startsWith()
The match() method uses a regular expression to search for matches in a string, returning an array of matches:
The matchAll() method is used to find all matches of a regular expression in a string. Unlike match(), which returns an array of matches, matchAll() returns an iterator that allows you to iterate through all matches and their capture groups.
the final method in this video is the repeat() method is used to create a new string by repeating the original string a specified number of times.