JS String Flashcards
string.length
Return’s string’s length
string.constructor
Returns string’s constructor function
string.prototype
Allows you to add properties and methods to an object
string.charAt(index)
Returns character at the specified index
string.charCodeAt(index)
Returns Unicode of character at specified index
string.concat(string 1, string 2, …, stringX)
Joins two or more strings and returns new joined string.
string.fromCharCode(n1, n2, …, nX)
Converts Unicode values to characters
string.indexOf(searchvalue, start)
Returns the position of the first occurrence of a specified value in a string
string.lastIndexOf(searchvalue, start)
Returns the position of the last found occurrence of a specified value in a string
string.localeCompare(compareString)
Compares two strings in current locale
string.match(regexp)
Searches for a match against a regular expression and returns the matches
string.replace(searchvalue, newvalue)
Searches a string for a specified value or regular expression and returns a new string where the specified values are replaced
string.search(searchvalue)
Searches a string for a specified value or regular expression and returns the position of the match
string.slice(start, end)
Extracts a part of a string and returns a new string
string.split(separator, limit)
Splits a string into an array of substrings