Hi,
I’d like to create a .Net array of a certain type inside IronRuby. It’s
needed, for example, for the overloads method.
For instance, try to retrieve the String.Trim(Char[]) method overload
from IronRuby… how do you achieve that?
Many thanks,
Shay.
Shay F.
http://www.ironshay.com
Follow me: http://twitter.com/ironshay
One way would be to do something like this
System::String.trim “a string”.to_clr_string.to_char_array
just about every class collection class in .NET allows you to initialize
it
with an IEnumerable of some sort so you can just use that constructor
with a
ruby array of objects
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto C.
Blog: http://flanders.co.nz
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)
System::Array.of(System::Char).new(10) instantiates an array of 10
characters.
Tomas