split a string into list of characters code example
Example 1: how to split a string into a list of characters in python
list("python")
#output ["p", "y", "t", "h", "o", "n"]
Example 2: split a string into an array of characters
const string = 'hi there';
const usingSplit = string.split('');
const usingSpread = [...string];
const usingArrayFrom = Array.from(string);
const usingObjectAssign = Object.assign([], string);
// Result
// [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e' ]