1//Loading the variable
2var mystr = '0000000020C90037:TEMP:data';
3
4//Splitting it with : as the separator
5var myarr = mystr.split(":");
6
7//Resulting array structure
8myarr = ['0000000020C90037', 'TEMP', 'data'];
1//split into array of strings.
2var str = "Well, how, are , we , doing, today";
3var res = str.split(",");
1var myString = 'no,u';
2var MyArray = myString.split(',');//splits the text up in chunks
3
1// bad example https://stackoverflow.com/questions/6484670/how-do-i-split-a-string-into-an-array-of-characters/38901550#38901550
2
3var arr = foo.split('');
4console.log(arr); // ["s", "o", "m", "e", "s", "t", "r", "i", "n", "g"]
1const str = 'The quick brown fox jumps over the lazy dog.';
2console.log(str.split(''));
3console.log(str.split(' '));
4console.log(str.split('ox'));
5> Array ["T", "h", "e", " ", "q", "u", "i", "c", "k", " ", "b", "r", "o", "w", "n", " ", "f", "o", "x", " ", "j", "u", "m", "p", "s", " ", "o", "v", "e", "r", " ", "t", "h", "e", " ", "l", "a", "z", "y", " ", "d", "o", "g", "."]
6> Array ["The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog."]
7> Array ["The quick brown f", " jumps over the lazy dog."]