KEMBAR78
String Methods in Javascript Part 2 1741064253 | PDF
0% found this document useful (0 votes)
18 views10 pages

String Methods in Javascript Part 2 1741064253

This document outlines various JavaScript string methods, including charAt, slice, substr, concat, repeat, at, match, and includes. Each method is described with its functionality, syntax, and the fact that they do not alter the original string. The document encourages further exploration of JavaScript topics.

Uploaded by

Azghar123. Noory
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views10 pages

String Methods in Javascript Part 2 1741064253

This document outlines various JavaScript string methods, including charAt, slice, substr, concat, repeat, at, match, and includes. Each method is described with its functionality, syntax, and the fact that they do not alter the original string. The document encourages further exploration of JavaScript topics.

Uploaded by

Azghar123. Noory
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

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

You might also like