JavaScript – String slice() Method
The String slice() method extracts a part of a string, returning the extracted part as a new string, without changing the original string.
The String slice() method extracts a part of a string, returning the extracted part as a new string, without changing the original string.
The String split() method splits a string into an array of substrings, and returns a new array, without changing the original string.
The String startsWith() method returns “true” if a string starts with a specified string, if not, it returns “false”.
The String substr() method extracts characters from a string starting at a specified position, returning the extracted part as a new string.
The String substring() method extracts characters from a string, between two positions, returning a substring, while not changing the original string.
The String toLocaleLowerCase() method converts a string to lowercase letters, using the current locale, without changing the original string.
The String toLocaleUpperCase() method converts a string to uppercase letters, using the current locale, without changing the original string.
The String toLowerCase() method converts a string to lowercase letters, without changing the original string.
The String toString() method returns a string object as a string, without changing the original string.
The String toUpperCase() method converts a string to uppercase letters, without changing the original string.
The String trim() method removes whitespace from both sides of a string, without changing the original string.
The String trimEnd() method removes whitespace from the end of a string, without changing the original string.
The String trimStart() method removes whitespace from the beginning of a string, without changing the original string.
The String valueOf() method returns the primitive value of a string, without changing the original string.
The Window alert() method displays an alert popup in the browser with a message and OK button, and is used to display information to the user.
The Window clearInterval() method clears a timer set with the setInterval() method.
The Window clearTimeout() method clears a timer set with the setTimeout() method.