javascript explode
//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
javascript explode
//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
js json to object
var jsonPerson = '{"first_name":"billy", "age":23}';
var personObject = JSON.parse(jsonPerson); //parse json string into JS object
string to int javascript
var text = '42px';
var integer = parseInt(text, 10);
// returns 42
js string to json
var obj = JSON.parse("{no:'u',my:'sql'}");//returnes {no:'u',my:'sql'}
javascript split
var names = 'Harry ;Fred Barney; Helen Rigby ; Bill Abel ;Chris Hand ';
console.log(names);
var re = /\s*(?:;|$)\s*/;
var nameList = names.split(re);
console.log(nameList);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us