[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

string comparison

Boris Glawe

12/14/2005 11:39:00 PM

Hi,

I have a class containing a string as an instance variable and I have a local
variable containing a string.

I compare these two strings with '==' and with the .eql? method:

###################################

obj.text = "hello world"
localtext = "hello world"

if obj.text == localtext
then
# do something
end

###################################

The condition never became true in my program. Thus I added some debug output.
This is the the debugging code:

if not obj.text == localtext
then
print "\"#{obj.text}\" is not equal \"#{localtext}\"\n"
end

This is, what it gave me:

"hello world" is not equal "hello world"

It's not worth trying the example above, since it's not the actual code. The
actual code in my project is much more complex, that's why I used this example
to discribe my problem.

Fact is that when the string comparison does not succeed I get an output like

"hello world" is not equal "hello "world"

Now it's your turn... What could cause this behaviour?

thanks and greets

Boris


P.S. I have cancelled another message, which had a syntax error in my example
1 Answer

juanjo

12/30/2009 10:15:00 PM

0

On Dec 26, 6:02 pm, Most Holy Mother Fucker <mother-
fuc...@wowmail.com> wrote:
> On Dec 26, 3:05 pm, juanjo <jonpe...@mindspring.com> wrote:
>
> > I spoke to Jesus today
>
> That wasn't the LORD Jesus!

You were not there, so how would you know? Jesus and I are tight. We
have been for years. We are distant cousins on my mother's side. We
were bar miztvah together years ago. He comes over regularly and we
hang out. He likes the way I do barbecue in the pit I have in the
back. He particularly enjoys the brisket but he will snarf down the
pulled pork as well hot links if I have them. He likes playing on the
PS3 in the living room since I got the new plasma tv. He says his dad
won't let him have one at home.

>
> > when he showed up to do the winter garden cleanup
>
> The Lord Jesus wouldn't never stoop so low.  You must be a talking
> about wunna them illegal immigrants.  New Sodom is full of 'em.

Nope. Had a beard and long hair, white robe, nail holes in his feet
and hands. Speaks really fluent Aramaic and Greek too. Last time we
had a barbecue and I ran out of sangria, he filled the pitcher with
water and turned it into you know what. Really good stuff too. As
for the work, Jesus likes doing gardening. He did a lot of terracing
back in the back on the hill and created some really nice planting
beds for me. I grow tomatoes, oregano, thyme, chile peppers and
apricots back there and I send a bunch over to his mom every year. Of
course Jesus grows some really great bud back there and I turn a blind
eye since he does all the weeding and other scut work. He has a pot
card so it isn't like it is illegal or anything. The doctor gave him
the prescription because he still has pain from a wound he got in his
side a while back.

>
> > and he told me that your real name is Max
>
> Your friend is a liar.  My name is Lurlean.  You're just confused.

I wouldn't call Jesus a liar, it might piss him off. I saw him turn a
couple of Mormon missionaries into drag queens one time cuz they were
being rude to him. They called him a fairy cuz he was wearing his
robe and we were in the Castro having coffee at Starbucks. He figured
it might help them to be a little more Christian if they had to walk
in someone else's high heels and feather boas. The guys at the coffee
shop thought it was hilarious.
>
> > and that you are a lying b****.
>
> What kinda person uses such foul words?!?!  Was this conversation held
> in English or Spanish?

I notice you do not dispute his characterization of you. I figured it
was accurate and your real name was Max because no red neck I know
speaks the way you do not writes the way you do. That is only found
in caricatures. Jesus is a pretty straight shooter. He calls a spade
a spade. No gratuitous bad language mind you but he is pretty fluent
when someone gets him going. Once I saw him go on for a good 25
minutes cursing some fool evangelist who was cursing at people,
judging them as sinners and the like. Jesus told him something about
the words in Matthew 25 and the guy told him to mind his own
business. Well Jesus did not care for that at all.He really let loose
on the guy. He did not repeat himself once. When he was done the guy
turned into a pig and ran down Market Street. Two of the old Filipino
guys who were hanging out playing chess nearby, yelled "lechon" and
took after the poor guy. I figure he was chicharons and crispy pata
by nightfall.

>
> > He also told me that his
>
> His - if'n you mean Jesus - which you don't really.


Well Max, who do I believe? You or my lying eyes? Like I said, I
have know Jesus all my life and you are just a faceless troll on the
internet.
>
> > real birthday was in April and
> > that Christmas was really a pagan holiday called Saturnalia in his
>
> His
>
> > day.
>
> Well, Saturnalia definitely was celebrated by pagans in the time of
> the Lord - but Christmas is something a'together different.  Pray to
> the True Lord Jesus and read your Holy Bible for the answers.  Then be
> generous with Our Holy Church.

I don't contribute money to heretics and I figure that Jesus would
know when his birthday is, most of us have a good idea when we were
born. Besides I have been to Israel in December and I know that there
are no sheep or shepards out on the hills that time of year. It's too
damn cold. Not to mention just about everything that Christians do to
celebrate Christmas is based on pagan traditions. No skin off my bum
really. I am happy with latkes and a menorah this time of year.
>
> Mother Fucker
> A True Christian

a true christian has no need to proclaim themselves as such.