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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -