File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
2024/11-nombres-de-archivos-codificados Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,15 @@ Luego, obtengo el índice del último punto `.` con el método `lastIndexOf()`:
72
72
73
73
``` js
74
74
// const lastDotIndex = '2023122512345678_sleighDesign.png.grinchwa'.lastIndexOf('.');
75
- const lastDotIndex = filename .lastIndexOf (' .' ); // 29
75
+ const lastDotIndex = filename .lastIndexOf (' .' ); // 33
76
76
```
77
77
78
78
Finalmente, utilizo el método ` slice() ` para extraer la parte del string que necesitamos:
79
79
80
80
``` js
81
81
// return '2023122512345678_sleighDesign.png.grinchwa'.slice(underscoreIndex + 1, lastDotIndex);
82
+ // return '2023122512345678_sleighDesign.png.grinchwa'.slice(16 + 1, 33);
83
+ // return '2023122512345678_sleighDesign.png.grinchwa'.slice(17, 33);
82
84
return filename .slice (underscoreIndex + 1 , lastDotIndex); // "sleighDesign.png"
83
85
```
84
86
You can’t perform that action at this time.
0 commit comments