Object - Methods

MethodDescription
charAtReturns the character at the specified index (position)
charCodeAtReturns the Unicode of the character at the specified index
concatJoins two or more strings, and returns a new joined strings
endsWithChecks whether a string ends with specified string/characters
exec 
fromCharCodeConverts Unicode values to characters
includesChecks whether a string contains the specified string/characters
indexOfReturns the position of the first found occurrence of a specified value in a string
lastIndexOfReturns the position of the last found occurrence of a specified value in a string
localeCompareCompares two strings in the current locale
matchSearches a string for a match against a regular expression, and returns the matches
parseInt 
parseFloat 
repeatReturns a new string with a specified number of copies of an existing string
replaceSearches a string for a specified value, or a regular expression, and returns a new string where the specified values are replaced
This only replaces the first match
searchSearches a string for a specified value, or regular expression, and returns the position of the match
sliceExtracts a part of a string and returns a new string
splitSplits a string into an array of substrings
startsWithChecks whether a string begins with specified characters
substrExtracts the characters from a string, beginning at a specified start position, and through the specified number of character
substringExtracts the characters from a string, between two specified indices
test 
toLocaleLowerCaseConverts a string to lowercase letters, according to the host's locale
toLocaleUpperCaseConverts a string to uppercase letters, according to the host's locale
toLowerCaseConverts a string to lowercase letters
toStringReturns the value of a String object
toUpperCaseConverts a string to uppercase letters
trimRemoves whitespace from both ends of a string
valueOfReturns the primitive value of a String object

Properties

PropertyDescription
lengthReturns the length of a string
prototypeAllows you to add properties and methods to an object


© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext