10 examples of 'jquery string split' in JavaScript

Every line of 'jquery string split' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
1export function split(separator, str){
2 if (arguments.length === 1) return _str => split(separator, _str)
3
4 return str.split(separator)
5}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

284function split(str) {
285 var args = getArgs(arguments);
286 return stringProto.split.apply(str || '', args);
287}
157function splitString(string) {
158 return string.split(new RegExp(separators.join('|'), 'g'));
159}
64splitString(str) {
65 try {
66 return str ? str.split(this.delimStr) : [];
67 }
68 catch (error) {
69 return str;
70 }
71}
8function split(val) {
9 return val.split(/\s+/);
10}
20function stringSplit(s, c) {
21 var a = s.indexOf(c);
22 if (a == -1) {
23 return [ s ];
24 }
25
26 var parts = [];
27 parts.push(s.substr(0,a));
28 while (a != -1) {
29 var a1 = s.indexOf(c, a + 1);
30 if (a1 != -1) {
31 parts.push(s.substr(a + 1, a1 - a - 1));
32 } else {
33 parts.push(s.substr(a + 1));
34 }
35 a = a1;
36 }
37
38 return parts;
39}
54function split( val ) {
55 return val.split( e.delimiter );
56}
12static split( s: string, regExp: RegExp ): string[] { return s.split( regExp ); }
144function splitString(value) {
145 return value.split(/\s+/g);
146}
31function splitArray(array) {
32 var blocks = new Array(array.length / 16);
33 for (var i = 0; i < blocks.length; i++) {
34 blocks[i] = array.slice(16 * i, 16 * i + 16);
35 }
36 return blocks;
37}

Related snippets