Skip to content

Commit a862c94

Browse files
committed
added substring
1 parent 9f37a4f commit a862c94

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,10 @@ const anthum = 'Amar Sonar Bangla Ami Tomake Valobashi';
144144
const anotherPart = anthum.substr(11,7)
145145
console.log(anotherPart);
146146
```
147+
- substring or slice both are same.
147148
```javascript
149+
const anthum = 'Amar Sonar Bangla Ami Tomake Valobashi';
150+
// substring
151+
const anotherAnotherPart = anthum.substring(2,10)
152+
console.log(anotherAnotherPart);
148153
```

string-slice.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ const words=anthum.split(' ');
55

66
// slice
77
const smallSlice = anthum.slice(0,10)
8-
// console.log(smallSlice);
8+
console.log(smallSlice);
99

1010
// substr
1111
const anotherPart = anthum.substr(2,10)
12-
console.log(anotherPart);
12+
// console.log(anotherPart);
13+
14+
// substring
15+
const anotherAnotherPart = anthum.substring(2,10)
16+
console.log(anotherAnotherPart);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy