change python to ruby, very basic -


i not familiar ruby, , want change python code ruby art project, here broken ruby script, know "split" function same, , not sure how 1 part of array in ruby. feel appreciated if can me out right now.

new = line.split(" ") lala = [w w in new if len(new)>=4] newone = lala[1..6].join(" ") + "\n" + lala[6...].join(" ") 

the initial python code

new = line.split(" ")  lala = [w w in new if len(new)>=4]  newone = (" ").join(lala[1:6]) +"\n" +(" ").join(lala[6:]) 

words = line.split(" ") s = words.select {|w| words.length >=4} result = s[1...6].join(" ") + "\n" + s[6..-1].join(" ") 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -