split string in jquery

JavaScript
[Edit]
+
0
-
0

split string in jQuery

1 2 3 4 5 6 7 8 9 10
// jQuery do not privide logic to split strings // it is necessary to use just JavaScript const text = 'Some text here ...'; const lines = text.split(' '); console.log(lines[0]); // Some console.log(lines[1]); // text console.log(lines[2]); // here console.log(lines[3]); // ...
[Edit]
+
0
-
0

split string in jQuery

1 2 3 4 5 6 7 8 9 10
// jQuery do not privide logic to split strings // it is necessary to use just JavaScript const text = 'Some text here ...'; const lines = text.split(/\s+/g); // splitting by any white character using regular expressions console.log(lines[0]); // Some console.log(lines[1]); // text console.log(lines[2]); // here console.log(lines[3]); // ...