File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -144,5 +144,10 @@ const anthum = 'Amar Sonar Bangla Ami Tomake Valobashi';
144
144
const anotherPart = anthum .substr (11 ,7 )
145
145
console .log (anotherPart);
146
146
```
147
+ - substring or slice both are same.
147
148
``` javascript
149
+ const anthum = ' Amar Sonar Bangla Ami Tomake Valobashi' ;
150
+ // substring
151
+ const anotherAnotherPart = anthum .substring (2 ,10 )
152
+ console .log (anotherAnotherPart);
148
153
```
Original file line number Diff line number Diff line change @@ -5,8 +5,12 @@ const words=anthum.split(' ');
5
5
6
6
// slice
7
7
const smallSlice = anthum . slice ( 0 , 10 )
8
- // console.log(smallSlice);
8
+ console . log ( smallSlice ) ;
9
9
10
10
// substr
11
11
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 ) ;
You can’t perform that action at this time.
0 commit comments