D
dare ruby
hi friends,
i have created a onject for string class, like
@news = String.new
and added contents using
@news >> somevalue
"somevalue" includes some alphabets, numbers, even whitespaces, special
characters.
now i need to seperate @news based on whitespace like
if @news contains 'kick the ball"
i need out put as, like
kick
the
ball
same if @ news contains 'kick the="size" ball="blue""
i need to split and output should be like
kick
the
ball
Some message : size
blue
how to solve this problem using ruby?
Thanks in advance....
i have created a onject for string class, like
@news = String.new
and added contents using
@news >> somevalue
"somevalue" includes some alphabets, numbers, even whitespaces, special
characters.
now i need to seperate @news based on whitespace like
if @news contains 'kick the ball"
i need out put as, like
kick
the
ball
same if @ news contains 'kick the="size" ball="blue""
i need to split and output should be like
kick
the
ball
Some message : size
blue
how to solve this problem using ruby?
Thanks in advance....