Metodo di matrice per dividere una stringa in caratteri in javascript

Esempi di codice

0
0

JavaScript Dividere la stringa in un array di caratteri

// split the text into array of chars using empty string
console.log("ABCDEFGHIJK".split(''));

// split the text into array of chars using empty string and limit to 3 chars
console.log("ABCDEFGHIJK".split('', 3));
0
0

split di una stringa ogni n caratteri javascript

console.log("abcd".match(/.{1,2}/g)); // ["ab", "cd"]

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
English
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................