This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_extPart_001_01C06B5C.100B4070
Content-Type: text/plain; 
 charseto-8859-1
Content-Transfer-Encoding: 7bit

ruby -e '"abc".each_byte {|b| p b }'
97
98
99

-> each_byte returns the ascii code...

maurice


# 
# I met a problem when I tried to write some Ruby code to learn 
# Ruby. The
# following code just can't work as expected,
# 
# "Hello".each_byte { |c|
#     if c "o"
#         print "oh, i got an o!", "\n"
#     end
# }
# 
# Seems in Ruby, in the comparsion c and "o" is always false. 
# How can I make
# the above code right? Thanks a lot.
# 
# Jiangyi Liu

------_extPart_001_01C06B5C.100B4070
Content-Type: text/html; 
 charseto-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV
ontent-Type" CONTENText/html; charseto-8859-1"> <META NAMEenerator" CONTENTS Exchange Server version 5.5.2651.75"> <TITLE>RE: [ruby-talk:7867] Comparsion Problem?</TITLE> </HEAD> <BODY> <P><FONT SIZE ruby -e '&quot;abc&quot;.each_byte {|b| p b }'</FONT> <BR><FONT SIZE 97</FONT> <BR><FONT SIZE 98</FONT> <BR><FONT SIZE 99</FONT> </P> <P><FONT SIZE -&gt; each_byte returns the ascii code...</FONT> </P> <P><FONT SIZE maurice</FONT> </P> <BR> <P><FONT SIZE # </FONT> <BR><FONT SIZE # I met a problem when I tried to write some Ruby code to learn </FONT> <BR><FONT SIZE # Ruby. The</FONT> <BR><FONT SIZE # following code just can't work as expected,</FONT> <BR><FONT SIZE # </FONT> <BR><FONT SIZE # &quot;Hello&quot;.each_byte { |c|</FONT> <BR><FONT SIZE #&nbsp;&nbsp;&nbsp;&nbsp; if c &quot;o&quot;</FONT> <BR><FONT SIZE #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;oh, i got an o!&quot;, &quot;\n&quot;</FONT> <BR><FONT SIZE #&nbsp;&nbsp;&nbsp;&nbsp; end</FONT> <BR><FONT SIZE # }</FONT> <BR><FONT SIZE # </FONT> <BR><FONT SIZE # Seems in Ruby, in the comparsion c and &quot;o&quot; is always false. </FONT> <BR><FONT SIZE # How can I make</FONT> <BR><FONT SIZE # the above code right? Thanks a lot.</FONT> <BR><FONT SIZE # </FONT> <BR><FONT SIZE # Jiangyi Liu</FONT> </P> </BODY> </HTML> ------_extPart_001_01C06B5C.100B4070--