There is an array of strings and I want to convert it in an array of symbols by iterating each string element and converting each string to symbol and push each symbol in to an array named symbols.
strings = ["A", "B", "C", "D", "E", "F", "G"] #array of strings
symbols = [strings.each{ |x| "x".to_sym.push }] #array of symbols
I have written above code and problem is with pushing element.
Please tell me the right way to push element.
Use Array#map instead: