Java String to char Array
String str = "example";
char[] ch = str.toCharArray();
Pable Sorren
String str = "example";
char[] ch = str.toCharArray();
$colors = "red,blue,green,orange";
$colorsArray = explode(",", $colors);
// our string
let string = 'ABCDEFG';
// splits every letter in string into an item in our array
let newArray = string.split('');
console.log(newArray); // OUTPUTS: [ "A", "B", "C", "D", "E", "F", "G" ]
//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
let str ='a,b,c,d'
let result =str.split(',');
//output:
['a','b','c','d']
const str = "Kamran";
let arr = [];
let k = 0;
for (let i of str) {
arr[k++] = i;
}
console.log(arr)