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()`:
7272
7373``` js
7474// const lastDotIndex = '2023122512345678_sleighDesign.png.grinchwa'.lastIndexOf('.');
75- const lastDotIndex = filename .lastIndexOf (' .' ); // 29
75+ const lastDotIndex = filename .lastIndexOf (' .' ); // 33
7676```
7777
7878Finalmente, utilizo el método ` slice() ` para extraer la parte del string que necesitamos:
7979
8080``` js
8181// 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);
8284return filename .slice (underscoreIndex + 1 , lastDotIndex); // "sleighDesign.png"
8385```
8486
You can’t perform that action at this time.
0 commit comments