J
James R. Leu
I'm trying to convert
"12:34" => "12:34"
(I know there is a CGI module with unescapeHTML(), I'm working in a
ruby environment that does not allow for additions of modules)
I'm trying:
"12:34".gsub(/&#(\d+);/,'\1'.to_i.chr)
But I get "1234"
Can anyone explain what I'm doing wrong?
BTW I know I can do:
"12:34".gsub(/&#(\d+);/) do
Integer($1).chr
end
but for some reason in the ruby environment I'm working in
I get 'Undefined method Integer for main:Object'
"12:34" => "12:34"
(I know there is a CGI module with unescapeHTML(), I'm working in a
ruby environment that does not allow for additions of modules)
I'm trying:
"12:34".gsub(/&#(\d+);/,'\1'.to_i.chr)
But I get "1234"
Can anyone explain what I'm doing wrong?
BTW I know I can do:
"12:34".gsub(/&#(\d+);/) do
Integer($1).chr
end
but for some reason in the ruby environment I'm working in
I get 'Undefined method Integer for main:Object'