Top 6+ Example Javascript Explode
Example Javascript Explode 1:
//split into array of strings.
var str = “Well, how, are , we , doing, today”;
var res = str.split(“,”);
Example Javascript Explode 2:
var foo = “overpopulation”;
var arr = foo.split(”);
console.log(arr); // [“s”, “o”, “m”, “e”, “s”, “t”, “r”, “i”, “n”, “g”]
Example Javascript Explode 3:
var input = “How are you doing today?”;
var result = input.split(” “);
// result is string[] {“How”, “are”, “you”, “doing”, “today?”}
Example Javascript Explode 4:
var myString = ‘no,u’;
var MyArray = myString.split(‘,’);//splits the text up in chunks
Example Javascript Explode 5:
var string = “This is an interesting sentence.”;
var response = str.split(” “);
console.log(response)
/* Expected result:
This,is,an,interesting,sentence.
(Note: returns array)
*/
Example Javascript Explode 6:
//Loading the variable
var mystr = ‘0000000020C90037:TEMP:data’;
//Splitting it with : as the separator
var myarr = mystr.split(“:”);
//Resulting array structure
myarr = [‘0000000020C90037’, ‘TEMP’, ‘data’];