From: Jeremy Gregorio Date: 2001-10-08T02:04:43+09:00 Subject: [ruby-talk:22200] newbie question about strings This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C14EB3.876F10C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Anyone know how to convert an integer to a string? I tried to do this: def to_s() final =3D "" =20 @edges.each {|e| final + e + " " } return final =20 end #method to_s Where @edges is an integer array. But it can't convert e to a string. = The << operator wants to convert any number < 255 to a character, which = isn't what I want. I suppose I could write a method, but it'd be better = to use what's built in if I can. Thanks in advance. Jeremy Gregorio rsilvergun@home.net ------=_NextPart_000_0009_01C14EB3.876F10C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Anyone know how to convert an integer = to a string?=20 I tried to do this:
 
def to_s()
 
 final =3D=20 ""   
 @edges.each {|e| final + e + " " = }
 return=20 final
 
end #method to_s
Where @edges is an integer array. But = it can't=20 convert e to a string. The << operator wants to convert any number = <=20 255 to a character, which isn't what I want. I suppose I could write a = method,=20 but it'd be better to use what's built in if I can. Thanks in=20 advance.
 
Jeremy Gregorio
rsilvergun@home.net
 
------=_NextPart_000_0009_01C14EB3.876F10C0--