-
-
Save parzibyte/8beb4b4d0a8dc4dbda2fd1159a39c1e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const separarCadenaEnArregloSiSuperaLongitud = (cadena, maximaLongitud) => { | |
const resultado = []; | |
let indice = 0; | |
while (indice < cadena.length) { | |
const pedazo = cadena.substring(indice, indice + maximaLongitud); | |
indice += maximaLongitud; | |
resultado.push(pedazo); | |
} | |
return resultado; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment