I want to split a string of text into single chars excluding any kind of symbol and numbers and only allowing space with rails using split but I cannot reproduce the desired result.
Like
only_words_and_spaces = /[^a-zA-Z\s]/
"Hello friends".split(only_words_and_spaces)
=> ["H", "e", "l", "l", "o", " ", "f", "r", "i", "e", "n", "d", "s"]
The regex seems to work well, but I cannot find a way to split that string into a single char array.