Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Convert string to array

var fruits = 'apple, orange, pear, banana, raspberry, peach';
var ar = fruits.split(', '); // split string on comma space
console.log( ar );
// [ "apple", "orange", "pear", "banana", "raspberry", "peach" ]
Source by www.dyn-web.com #
 
PREVIOUS NEXT
Tagged: #Convert #string #array
ADD COMMENT
Topic
Name
9+2 =