explode string javascript code example
Example 1: js explode equivalent
var mystr = '0000000020C90037:TEMP:data';
var myarr = mystr.split(":");
myarr = ['0000000020C90037', 'TEMP', 'data'];
Example 2: javascript explode
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
Example 3: string split javascript
var myString = "An,array,in,a,string,separated,by,a,comma";
var myArray = myString.split(",");
Example 4: string to array javascript
const str = 'Hello!';
console.log(Array.from(str));
Example 5: javascript split string
const path = "/usr/home/chucknorris"
let result = path.split("/")
console.log(result)
let username = result[3]
console.log(username)
Example 6: in javascript how to split string
var str = 'It iS a 5r&e@@t Day.'
var array = str.split(" ");
print(array);
var str = 'It iS a 5r&e@@t Day.'
var array = str.split(" ",2);
print(array);