数组和C#System.Array类 [英] Arrays and the C# System.Array Class
问题描述
据我所知,数组如:
From what I understand, arrays like:
string[]
int[]
object[]
MyOwnClas[] //Created class
所有使用System.Array类来收集他们的功能。我的问题是,这些字符串和对象数组以及自定义类型如何转换为System.Array类?是否有一些底层转换,我可以从类型数组(已使用
CreateInstance)转换为字符串[]?
All use System.Array class to gather their functionality. My question is, how do these arrays of strings and objects and custom types transform into the System.Array class? Is there some underlying conversion and can I convert from a Type Array (that has used CreateInstance) to say string[]?
推荐答案
要将特定类型或数组转换为字符串数组,您需要编写逻辑,以便将要转换的特定类型对象转换为字符串,否则它将不适合您。
For converting a particular type or array to string array, you would need to write the logic for how you would want to convert that particular type of object to be transformed in to string, otherwise it would not work for you.
希望有所帮助
这篇关于数组和C#System.Array类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!