On May 27, 11:31 am, Ruby One <[email protected]>
wrote:
> have this function with whe work cuts the word inbetween which i
> don't want want please help.
>
You don't necessarily get the most help by posting essentially the
same thing 4 times. If I were you i'd be working with the array of
split up words (word_arry in your code) rather than trying to slice up
words
Fred
> words = "Kid games need to be both fun and educational. Aimed at ages
> pre-K through middle school, safe environment to discover their
> abilities and learn new skills with interactive and fun computer
> games. Our games build skills in math, logic, memory, vocabulary,
> alphabet, spelling, geography, computer skills, color identification,
> shape identification and other various problem solving. Our commitment
> to parents, teachers, and kids, is to connect earning and skill
> building with a sense of challenge, fun, and self esteem."
>
> line_length = 40
>
> word_arry = words.split(" ")
>
> text = (0..(words.length / line_length)).inject([]) {|v,num| start =
> num * line_length; v << %Q{<= #{words[(start)...(start +
> line_length)]} =>}}
> text.join("\n")
>
> @counter=""
> text.each do |ts|
>
> @counter += ts + "</br>"
>
> end
>
> thanks
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---