S
smitty
Is there a more efficient way to convert a string such as
"abcdef" to "abcdef" ?
Currently I am doing the following:
a="abcdef"
a.delete!("&#")
ar = a.split(';')
arn = ar.collect { |s| Integer(s) }
s = arn.pack("U*")
puts "s=#{s.inspect}"
I need to do this for thousands of records that are
loaded into a database, so I'm a bit concerned
about repeatedly executing all of the above code.
Thanks
"abcdef" to "abcdef" ?
Currently I am doing the following:
a="abcdef"
a.delete!("&#")
ar = a.split(';')
arn = ar.collect { |s| Integer(s) }
s = arn.pack("U*")
puts "s=#{s.inspect}"
I need to do this for thousands of records that are
loaded into a database, so I'm a bit concerned
about repeatedly executing all of the above code.
Thanks