Answers for "segregate value by _ using jquery like explode"

0

javascript explode space

var str   = "my car is red";
var stringArray = str.split(/(\s+)/);

console.log(stringArray); // ["my", " ", "car", " ", "is", " ", "red"]
Posted by: Guest on March-27-2020
0

segregate value by _ using jquery like explode

var myString = 'IE, Firefox, Opera, Chrome, Safari';
var myStringArray = myString.split(',');

The values are now in myStringArray - myStringArray[0] would be 'IE'
Posted by: Guest on September-23-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language