JAVASCRIPT STRING
METHODS ( Part 2 )
1. charAt
The charAt() method returns
the character at a specified
index in a string.
The index of the first
character is 0, the second 1, ...
string.charAt(index)
2
2. slice
The slice() method extracts a
part of a string and returns the
extracted part .
The slice() method does not
change the original string.
string.slice(start, end)
3
3. substr
The substr() method begins at
a specified position, and
returns a specified number of
characters.
The substr() method
does not change the original
string.
string.substr(start, length)
4
4. concat
The concat() method joins two
or more strings
The concat() method does not
change the existing strings.
The concat() method returns a
new string.
string.concat(str1, str2, ..., strX)
5
5. repeat
The repeat() method returns a
string with a number of copies
of a string.
The repeat() method returns a
new string.
string.repeat(count)
6
6. at
The .at() method is used to get a
character from a string at a
specific position.
The at() method returns the
same as when used []
string.at(index)
7
7. match
The .match() method is used to
find matches of a pattern
(regular expression) inside a
string.
The .match() method returns an
array of matches or null if no
match is found.
string.match(pattern)
8
8. includes
The includes() method returns
true if a string contains a
specified string otherwise
returns false
The includes() method is case
sensitive.
string.includes(searchvalue, start)
9
KEEP EXPLORING
JAVASCRIPT
WITH US
Dont forget to tell