Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert string to array

let string = "Hello World!"
let arr = string.split(' '); // returns ["Hello","World!"]
let arr = string.split(''); // returns ["H","e","l","l"," ","W","o","r","l","d","!"]

let string = "Apple, Orange, Pear, Grape"
let arr = string.split(','); // returns ["Apple","Orange","Pear","Grape"]
Source by www.dyn-web.com #
 
PREVIOUS NEXT
Tagged: #convert #string #array
ADD COMMENT
Topic
Name
7+5 =