# (this give me list eg : ,s, s, m ... list = list + "," + name
i want using split and then join ...try to use below..i don't know what i am doing
list = list.split(',') + name + collect{|c| c.name}.to_sentence list = list.split(',') + name + collect{|c| c.name}.Join(",")
any ideas??
The string in JavaScript can be converted into a character array by using the split() and Array. from() functions.
Java For Testers String str = "Tutorial"; Now, use the toCharArray() method to convert string to char array. char[] ch = str. toCharArray();
To convert String to array in Python, use String. split() method. The String . split() method splits the String from the delimiter and returns the splitter elements as individual list items.
I noticed that this page comes up for generic google search of "string to char array ruby".
If you just want to convert string to char array in ruby,
"string".chars # ["s", "t", "r", "i", "n", "g"]
i don't understand your question, but if you want to convert string to array
>> "a string".split("") => ["a", " ", "s", "t", "r", "i", "n", "g"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With