I\'ve tried to look around the web for answers to splitting a string into an array of characters but I can\'t seem to find a simple method
str.split(//)
split()
inbuilt function will only separate the value on the basis of certain condition but in the single word, it cannot fulfill the condition. So, it can be solved with the help of list()
. It internally calls the Array and it will store the value on the basis of an array.
Suppose,
a = "bottle"
a.split() // will only return the word but not split the every single char.
a = "bottle"
list(a) // will separate ['b','o','t','t','l','e']