Porzione di stringa per il numero di caratteri javascript

Esempi di codice

5
0

javascript fetta stringa di caratteri

var input = 'john smith~123 Street~Apt 4~New York~NY~12345';

var fields = input.split('~');

var name = fields[0];
var street = fields[1];
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));

In altre lingue

Questa pagina è in altre lingue

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