[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Help with <<-EOF

Mario Ruiz

5/11/2009 4:37:00 PM

Hi,

I have a piece of code like:
xmlData=<<-EOF
xml code
EOF

I need to change it into:
xmlData="
xml code
"

but I don't know why... it doesn't work when I change it into a normal
string.

Any idea?
--
Posted via http://www.ruby-....

5 Answers

Eleanor McHugh

5/11/2009 5:02:00 PM

0

On 11 May 2009, at 17:37, Mario Ruiz wrote:
> Hi,
>
> I have a piece of code like:
> xmlData=<<-EOF
> xml code
> EOF
>
> I need to change it into:
> xmlData="
> xml code
> "
>
> but I don't know why... it doesn't work when I change it into a normal
> string.
>
> Any idea?

Are you escaping all double quotes in the string?
Also, why do you need to make the change?


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-...
----
raise ArgumentError unless @reality.responds_to? :reason


Mario Ruiz

5/11/2009 5:19:00 PM

0

There are no double quotes...

I need to do it because is a requirement from the client :(
(all string should be assigned by ")

Eleanor McHugh wrote:
> On 11 May 2009, at 17:37, Mario Ruiz wrote:
>> "
--
Posted via http://www.ruby-....

Mario Ruiz

5/11/2009 5:23:00 PM

0

Ok... I did it.
I think the problem was a special character at the beginning of the
string.
Thanks for your time.

Mario Ruiz wrote:
> There are no double quotes...

--
Posted via http://www.ruby-....

Eleanor McHugh

5/11/2009 5:26:00 PM

0

On 11 May 2009, at 18:19, Mario Ruiz wrote:
> There are no double quotes...
>
> I need to do it because is a requirement from the client :(
> (all string should be assigned by ")

Well I guess there's no accounting for clients lol


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-...
----
raise ArgumentError unless @reality.responds_to? :reason


Robert Klemme

5/11/2009 6:33:00 PM

0

On 11.05.2009 19:26, Eleanor McHugh wrote:
> On 11 May 2009, at 18:19, Mario Ruiz wrote:
>> There are no double quotes...
>>
>> I need to do it because is a requirement from the client :(
>> (all string should be assigned by ")
>
> Well I guess there's no accounting for clients lol

I'd be curios to hear the reason for this requirement.

Cheers

robert